diff --git a/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj b/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj index e4844cb6..7bf0b35c 100644 --- a/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj +++ b/examples/WireMock.Net.WebApplication/WireMock.Net.WebApplication.NETCore2.csproj @@ -6,6 +6,7 @@ WireMock.Net.WebApplication.Program WireMock.Net.WebApplication WireMock.Net.WebApplication + efcf4a18-fd7c-4622-825d-336d65290599 diff --git a/src/WireMock.Net/Http/HttpClientHelper.cs b/src/WireMock.Net/Http/HttpClientHelper.cs index aa0b7476..883cb897 100644 --- a/src/WireMock.Net/Http/HttpClientHelper.cs +++ b/src/WireMock.Net/Http/HttpClientHelper.cs @@ -71,7 +71,7 @@ namespace WireMock.Http // Call the URL var httpResponseMessage = await client.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseContentRead); - // Parse httpResponseMessage + // Create ResponseMessage return await HttpResponseMessageHelper.Create(httpResponseMessage, requiredUri, originalUri); } } diff --git a/src/WireMock.Net/HttpsCertificate/ClientCertificateHelper.cs b/src/WireMock.Net/HttpsCertificate/ClientCertificateHelper.cs index 85c12b21..bd81e414 100644 --- a/src/WireMock.Net/HttpsCertificate/ClientCertificateHelper.cs +++ b/src/WireMock.Net/HttpsCertificate/ClientCertificateHelper.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Security.Cryptography.X509Certificates; namespace WireMock.HttpsCertificate @@ -26,6 +25,7 @@ namespace WireMock.HttpsCertificate throw new FileNotFoundException("No certificate found with specified Thumbprint or SubjectName.", thumbprintOrSubjectName); } } + // Use the first matching certificate. return matchingCertificates[0]; } diff --git a/src/WireMock.Net/IMapping.cs b/src/WireMock.Net/IMapping.cs index 10e93db8..4dca9571 100644 --- a/src/WireMock.Net/IMapping.cs +++ b/src/WireMock.Net/IMapping.cs @@ -65,6 +65,14 @@ namespace WireMock /// bool IsStartState { get; } + /// + /// Gets a value indicating whether this mapping is an Admin Interface. + /// + /// + /// true if this mapping is an Admin Interface; otherwise, false. + /// + bool IsAdminInterface { get; } + /// /// ResponseToAsync /// @@ -79,13 +87,5 @@ namespace WireMock /// The Next State. /// The . RequestMatchResult GetRequestMatchResult(RequestMessage requestMessage, [CanBeNull] string nextState); - - /// - /// Gets a value indicating whether this mapping is an Admin Interface. - /// - /// - /// true if this mapping is an Admin Interface; otherwise, false. - /// - bool IsAdminInterface { get; } } } \ No newline at end of file diff --git a/src/WireMock.Net/Mapping.cs b/src/WireMock.Net/Mapping.cs index edb6a099..b35a47c3 100644 --- a/src/WireMock.Net/Mapping.cs +++ b/src/WireMock.Net/Mapping.cs @@ -14,55 +14,39 @@ namespace WireMock /// public Guid Guid { get; } - /// - /// Gets the unique title. - /// + /// public string Title { get; } - /// - /// The full filename path for this mapping (only defined for static mappings). - /// + /// public string Path { get; set; } - /// - /// Gets the priority. - /// + /// public int Priority { get; } - /// - /// Scenario. - /// + /// [CanBeNull] public string Scenario { get; } - /// - /// Execution state condition for the current mapping. - /// + /// [CanBeNull] public string ExecutionConditionState { get; } - /// - /// The next state which will be signaled after the current mapping execution. - /// In case the value is null, state will not be changed. - /// + /// [CanBeNull] public string NextState { get; } - /// - /// The Request matcher. - /// + /// public IRequestMatcher RequestMatcher { get; } - /// - /// The Provider. - /// + /// public IResponseProvider Provider { get; } - /// - /// Is State started ? - /// + /// public bool IsStartState => Scenario == null || Scenario != null && NextState != null && ExecutionConditionState == null; + /// + public bool IsAdminInterface => Provider is DynamicResponseProvider || Provider is DynamicAsyncResponseProvider || Provider is ProxyAsyncResponseProvider; + /// /// Initializes a new instance of the class. /// @@ -88,22 +72,13 @@ namespace WireMock NextState = nextState; } - /// - /// The response to. - /// - /// The request message. - /// The . + /// public async Task ResponseToAsync(RequestMessage requestMessage) { return await Provider.ProvideResponseAsync(requestMessage); } - /// - /// Gets the RequestMatchResult based on the RequestMessage. - /// - /// The request message. - /// The Next State. - /// The . + /// public RequestMatchResult GetRequestMatchResult(RequestMessage requestMessage, [CanBeNull] string nextState) { var result = new RequestMatchResult(); @@ -126,13 +101,5 @@ namespace WireMock return result; } - - /// - /// Gets a value indicating whether this mapping is an Admin Interface. - /// - /// - /// true if this mapping is an Admin Interface; otherwise, false. - /// - public bool IsAdminInterface => Provider is DynamicResponseProvider || Provider is DynamicAsyncResponseProvider || Provider is ProxyAsyncResponseProvider; } } \ No newline at end of file