Skip to content

Commit adc4aa9

Browse files
committed
Fix several small misstakes
1 parent 0dbca5a commit adc4aa9

19 files changed

+76
-71
lines changed

src/TestableHttpClient/HttpRequestMessageAsserter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// This class makes it easy to create assertions on a collection of <seealso cref="HttpRequestMessage"/>s.
55
/// </summary>
6-
internal class HttpRequestMessageAsserter : IHttpRequestMessagesCheck
6+
internal sealed class HttpRequestMessageAsserter : IHttpRequestMessagesCheck
77
{
88
private readonly List<string> _expectedConditions = new();
99

@@ -56,6 +56,7 @@ private void Assert(int? expectedCount = null)
5656
/// Asserts whether requests comply with a specific filter.
5757
/// </summary>
5858
/// <param name="requestFilter">The filter to filter requests with before asserting.</param>
59+
/// <param name="expectedNumberOfRequests">The number of requests with this filter.</param>
5960
/// <param name="condition">The name of the condition, used in the exception message.</param>
6061
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
6162
[AssertionMethod]

src/TestableHttpClient/HttpRequestMessagesCheckExtensions.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static IHttpRequestMessagesCheck WithHttpVersion(this IHttpRequestMessag
8888
/// <summary>
8989
/// Asserts whether requests were made with a specific header name. Values are ignored.
9090
/// </summary>
91-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeader"/></remarks>
91+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeaders"/></remarks>
9292
/// <param name="check">The implementation that hold all the request messages.</param>
9393
/// <param name="headerName">The name of the header that is expected.</param>
9494
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
@@ -97,7 +97,7 @@ private static IHttpRequestMessagesCheck WithHttpVersion(this IHttpRequestMessag
9797
/// <summary>
9898
/// Asserts whether requests were made with a specific header name. Values are ignored.
9999
/// </summary>
100-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeader"/></remarks>
100+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeaders"/></remarks>
101101
/// <param name="check">The implementation that hold all the request messages.</param>
102102
/// <param name="headerName">The name of the header that is expected.</param>
103103
/// <param name="expectedNumberOfRequests">The expected number of requests.</param>
@@ -115,7 +115,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess
115115
/// <summary>
116116
/// Asserts whether requests were made with a specific header name and value.
117117
/// </summary>
118-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeader"/></remarks>
118+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeaders"/></remarks>
119119
/// <param name="check">The implementation that hold all the request messages.</param>
120120
/// <param name="headerName">The name of the header that is expected.</param>
121121
/// <param name="headerValue">The value of the expected header, supports wildcards.</param>
@@ -125,7 +125,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess
125125
/// <summary>
126126
/// Asserts whether requests were made with a specific header name and value.
127127
/// </summary>
128-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeader"/></remarks>
128+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpRequestHeaders"/></remarks>
129129
/// <param name="check">The implementation that hold all the request messages.</param>
130130
/// <param name="headerName">The name of the header that is expected.</param>
131131
/// <param name="headerValue">The value of the expected header, supports wildcards.</param>
@@ -145,7 +145,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess
145145
/// <summary>
146146
/// Asserts whether requests were made with a specific header name. Values are ignored.
147147
/// </summary>
148-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeader"/></remarks>
148+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeaders"/></remarks>
149149
/// <param name="check">The implementation that hold all the request messages.</param>
150150
/// <param name="headerName">The name of the header that is expected.</param>
151151
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
@@ -154,7 +154,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess
154154
/// <summary>
155155
/// Asserts whether requests were made with a specific header name. Values are ignored.
156156
/// </summary>
157-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeader"/></remarks>
157+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeaders"/></remarks>
158158
/// <param name="check">The implementation that hold all the request messages.</param>
159159
/// <param name="headerName">The name of the header that is expected.</param>
160160
/// <param name="expectedNumberOfRequests">The expected number of requests.</param>
@@ -172,17 +172,17 @@ private static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMess
172172
/// <summary>
173173
/// Asserts whether requests were made with a specific header name and value.
174174
/// </summary>
175-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeader"/></remarks>
175+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeaders"/></remarks>
176176
/// <param name="check">The implementation that hold all the request messages.</param>
177177
/// <param name="headerName">The name of the header that is expected.</param>
178178
/// <param name="headerValue">The value of the expected header, supports wildcards.</param>
179179
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
180-
public static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithContentHeader(check, headerName, headerValue, (int?)null);
180+
public static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithContentHeader(check, headerName, headerValue, null);
181181

182182
/// <summary>
183183
/// Asserts whether requests were made with a specific header name and value.
184184
/// </summary>
185-
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeader"/></remarks>
185+
/// <remarks>This method only asserts headers on <see cref="System.Net.Http.Headers.HttpContentHeaders"/></remarks>
186186
/// <param name="check">The implementation that hold all the request messages.</param>
187187
/// <param name="headerName">The name of the header that is expected.</param>
188188
/// <param name="headerValue">The value of the expected header, supports wildcards.</param>
@@ -231,7 +231,7 @@ private static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesChe
231231
/// <param name="headerName">The name of the header that is expected.</param>
232232
/// <param name="headerValue">The value of the expected header, supports wildcards.</param>
233233
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
234-
public static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithHeader(check, headerName, headerValue, (int?)null);
234+
public static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithHeader(check, headerName, headerValue, null);
235235

236236
/// <summary>
237237
/// Asserts whether requests were made with a specific header name and value.
@@ -293,6 +293,7 @@ private static IHttpRequestMessagesCheck WithContent(this IHttpRequestMessagesCh
293293
/// </summary>
294294
/// <param name="check">The implementation that hold all the request messages.</param>
295295
/// <param name="jsonObject">The object representation of the expected request content.</param>
296+
/// <param name="jsonSerializerOptions">The serializer options that should be used for serializing te content.</param>
296297
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
297298
/// <remarks>Note that on .NET Framework, the HttpClient might dispose the content after sending the request.</remarks>
298299
public static IHttpRequestMessagesCheck WithJsonContent(this IHttpRequestMessagesCheck check, object? jsonObject, JsonSerializerOptions jsonSerializerOptions) => WithJsonContent(check, jsonObject, jsonSerializerOptions, null);
@@ -312,6 +313,7 @@ private static IHttpRequestMessagesCheck WithContent(this IHttpRequestMessagesCh
312313
/// </summary>
313314
/// <param name="check">The implementation that hold all the request messages.</param>
314315
/// <param name="jsonObject">The object representation of the expected request content.</param>
316+
/// <param name="jsonSerializerOptions">The serializer options that should be used for serializing the content.</param>
315317
/// <param name="expectedNumberOfRequests">The expected number of requests.</param>
316318
/// <returns>The <seealso cref="IHttpRequestMessagesCheck"/> for further assertions.</returns>
317319
/// <remarks>Note that on .NET Framework, the HttpClient might dispose the content after sending the request.</remarks>

src/TestableHttpClient/HttpResponseContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// This class contains contextual information for generating responses.
55
/// </summary>
6-
public class HttpResponseContext
6+
public sealed class HttpResponseContext
77
{
88
internal HttpResponseContext(HttpRequestMessage httpRequestMessage, IReadOnlyCollection<HttpRequestMessage> httpRequestMessages, HttpResponseMessage httpResponseMessage, TestableHttpMessageHandlerOptions? options = null)
99
{
@@ -14,15 +14,15 @@ internal HttpResponseContext(HttpRequestMessage httpRequestMessage, IReadOnlyCol
1414
}
1515

1616
/// <summary>
17-
/// The request message that is send by the HttpClient.
17+
/// The request message that is sent by the HttpClient.
1818
/// </summary>
1919
public HttpRequestMessage HttpRequestMessage { get; }
2020
/// <summary>
2121
/// The requests that were send by the HttpClient.
2222
/// </summary>
2323
public IReadOnlyCollection<HttpRequestMessage> HttpRequestMessages { get; }
2424
/// <summary>
25-
/// The response message that will be send back to the HttpClient.
25+
/// The response message that will be sent back to the HttpClient.
2626
/// </summary>
2727
public HttpResponseMessage HttpResponseMessage { get; }
2828
/// <summary>

src/TestableHttpClient/Response/ConfiguredResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class ConfiguredResponse : IResponse
3+
internal sealed class ConfiguredResponse : IResponse
44
{
55
private readonly IResponse innerResponse;
66
private readonly Action<HttpResponseMessage> configureResponse;

src/TestableHttpClient/Response/DelayedResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class DelayedResponse : IResponse
3+
internal sealed class DelayedResponse : IResponse
44
{
55
private readonly IResponse delayedResponse;
66
private readonly TimeSpan delay;

src/TestableHttpClient/Response/JsonResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class JsonResponse : HttpResponse
3+
internal sealed class JsonResponse : HttpResponse
44
{
55
public JsonResponse(object? content, string? contentType = null)
66
{

src/TestableHttpClient/Response/RoutingResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using static TestableHttpClient.Responses;
33

44
namespace TestableHttpClient.Response;
5-
internal class RoutingResponse : IResponse
5+
internal sealed class RoutingResponse : IResponse
66
{
77
public Task ExecuteAsync(HttpResponseContext context, CancellationToken cancellationToken)
88
{

src/TestableHttpClient/Response/SelectableResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class SelectableResponse : IResponse
3+
internal sealed class SelectableResponse : IResponse
44
{
55
private readonly Func<HttpResponseContext, IResponse> selector;
66

src/TestableHttpClient/Response/SequencedResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class SequencedResponse : IResponse
3+
internal sealed class SequencedResponse : IResponse
44
{
55
private readonly List<IResponse> responses;
66
public SequencedResponse(IEnumerable<IResponse> responses)

src/TestableHttpClient/Response/TextResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace TestableHttpClient.Response;
22

3-
internal class TextResponse : HttpResponse
3+
internal sealed class TextResponse : HttpResponse
44
{
55
public TextResponse(string content, Encoding? encoding = null, string? mediaType = null)
66
{

0 commit comments

Comments
 (0)