diff --git a/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs b/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs index 9cc6b1ae..ed610e66 100644 --- a/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs +++ b/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs @@ -108,13 +108,12 @@ namespace WireMock.Owin { IsStarted = true; #if NETSTANDARD1_3 - _logger.Info("WireMock.Net server using netstandard1.3"); + _logger.Info("WireMock.Net server using netstandard1.3"); _host.Run(_cts.Token); #else _logger.Info("WireMock.Net server using netstandard2.0"); _host.Run(); #endif - } catch (Exception e) { diff --git a/src/WireMock.Net/Owin/IOwinSelfHost.cs b/src/WireMock.Net/Owin/IOwinSelfHost.cs index 9fcb5455..81828ef6 100644 --- a/src/WireMock.Net/Owin/IOwinSelfHost.cs +++ b/src/WireMock.Net/Owin/IOwinSelfHost.cs @@ -17,17 +17,11 @@ namespace WireMock.Owin /// /// Gets the urls. /// - /// - /// The urls. - /// List Urls { get; } /// /// Gets the ports. /// - /// - /// The ports. - /// List Ports { get; } /// diff --git a/src/WireMock.Net/Owin/OwinRequestMapper.cs b/src/WireMock.Net/Owin/OwinRequestMapper.cs index 43355ae4..d8df15c3 100644 --- a/src/WireMock.Net/Owin/OwinRequestMapper.cs +++ b/src/WireMock.Net/Owin/OwinRequestMapper.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -// using System.IO; using System.Linq; -// using System.Text; using System.Threading.Tasks; using WireMock.Util; #if !NETSTANDARD diff --git a/src/WireMock.Net/Owin/OwinSelfHost.cs b/src/WireMock.Net/Owin/OwinSelfHost.cs index 675d88f5..1234ea8d 100644 --- a/src/WireMock.Net/Owin/OwinSelfHost.cs +++ b/src/WireMock.Net/Owin/OwinSelfHost.cs @@ -80,7 +80,7 @@ namespace WireMock.Owin app.Use(_options); _options.PostWireMockMiddlewareInit?.Invoke(app); }; - + foreach (var url in Urls) { servers.Add(WebApp.Start(url, startup)); @@ -104,7 +104,7 @@ namespace WireMock.Owin { IsStarted = false; // Dispose all servers in finally block to make sure clean up allocated resource on error happening - servers.ForEach((s) => s.Dispose()); + servers.ForEach(s => s.Dispose()); } } } diff --git a/src/WireMock.Net/Server/FluentMockServer.cs b/src/WireMock.Net/Server/FluentMockServer.cs index aafb5b8b..c7dfce82 100644 --- a/src/WireMock.Net/Server/FluentMockServer.cs +++ b/src/WireMock.Net/Server/FluentMockServer.cs @@ -32,7 +32,7 @@ namespace WireMock.Server /// Gets a value indicating whether this server is started. /// [PublicAPI] - public bool IsStarted { get => _httpServer == null ? false : _httpServer.IsStarted; } + public bool IsStarted => _httpServer != null && _httpServer.IsStarted; /// /// Gets the ports. @@ -200,7 +200,7 @@ namespace WireMock.Server { throw new TimeoutException($"Service start timed out after {TimeSpan.FromMilliseconds(settings.StartTimeout)}"); } - ctsStartTimeout.Token.WaitHandle.WaitOne(100); + ctsStartTimeout.Token.WaitHandle.WaitOne(ServerStartDelay); } }