Concurrent issue (#88) (#90)

* concurrent

* uni tests
This commit is contained in:
Stef Heyenrath
2018-02-14 18:30:06 +00:00
committed by GitHub
parent 51070dab63
commit 693778659e
8 changed files with 36 additions and 47 deletions

View File

@@ -55,7 +55,7 @@ namespace WireMock.Owin
RequestMatchResult requestMatchResult = null;
try
{
foreach (var mapping in _options.Mappings.Where(m => m?.Scenario != null))
foreach (var mapping in _options.Mappings.Values.Where(m => m?.Scenario != null))
{
// Set start
if (!_options.Scenarios.ContainsKey(mapping.Scenario) && mapping.IsStartState)
@@ -64,7 +64,7 @@ namespace WireMock.Owin
}
}
var mappings = _options.Mappings
var mappings = _options.Mappings.Values
.Select(m => new
{
Mapping = m,

View File

@@ -21,7 +21,7 @@ namespace WireMock.Owin
public bool AllowPartialMapping { get; set; }
public IList<Mapping> Mappings { get; set; } = new List<Mapping>();
public IDictionary<Guid, Mapping> Mappings { get; set; } = new ConcurrentDictionary<Guid, Mapping>();
public ObservableCollection<LogEntry> LogEntries { get; } = new ConcurentObservableCollection<LogEntry>();