Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Source/Mockolate/Web/HttpClientExtensions.Setup.Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static partial class HttpClientExtensions
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> DeleteAsync(
IParameter<string?>? requestUri)
=> setup.DeleteAsync(requestUri, It.IsAny<CancellationToken>());
=> setup.DeleteAsync(requestUri ?? It.IsAny<string?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
Expand All @@ -33,15 +33,15 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> DeleteAsync(
IParameter<Uri?>? requestUri)
=> setup.DeleteAsync(requestUri, It.IsAny<CancellationToken>());
=> setup.DeleteAsync(requestUri ?? It.IsAny<Uri?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
/// <see cref="System.Net.Http.HttpClient.DeleteAsync(string?, System.Threading.CancellationToken)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> DeleteAsync(
IParameter<string?>? requestUri,
IParameter<string?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -65,7 +65,7 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> DeleteAsync(
IParameter<Uri?>? requestUri,
IParameter<Uri?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
8 changes: 4 additions & 4 deletions Source/Mockolate/Web/HttpClientExtensions.Setup.Get.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static partial class HttpClientExtensions
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> GetAsync(
IParameter<string?>? requestUri)
=> setup.GetAsync(requestUri, It.IsAny<CancellationToken>());
=> setup.GetAsync(requestUri ?? It.IsAny<string?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
Expand All @@ -33,15 +33,15 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> GetAsync(
IParameter<Uri?>? requestUri)
=> setup.GetAsync(requestUri, It.IsAny<CancellationToken>());
=> setup.GetAsync(requestUri ?? It.IsAny<Uri?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
/// <see cref="System.Net.Http.HttpClient.GetAsync(string?, System.Threading.CancellationToken)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> GetAsync(
IParameter<string?>? requestUri,
IParameter<string?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -65,7 +65,7 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> GetAsync(
IParameter<Uri?>? requestUri,
IParameter<Uri?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
22 changes: 14 additions & 8 deletions Source/Mockolate/Web/HttpClientExtensions.Setup.Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ public static partial class HttpClientExtensions
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PatchAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PatchAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PatchAsync(
requestUri ?? It.IsAny<string?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
Expand All @@ -35,17 +38,20 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PatchAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PatchAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PatchAsync(
requestUri ?? It.IsAny<Uri?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
/// <see cref="System.Net.Http.HttpClient.PatchAsync(string?, HttpContent?, System.Threading.CancellationToken)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PatchAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<string?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -70,8 +76,8 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PatchAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<Uri?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
22 changes: 14 additions & 8 deletions Source/Mockolate/Web/HttpClientExtensions.Setup.Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public static partial class HttpClientExtensions
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PostAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PostAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PostAsync(
requestUri ?? It.IsAny<string?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
Expand All @@ -34,17 +37,20 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PostAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PostAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PostAsync(
requestUri ?? It.IsAny<Uri?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
/// <see cref="System.Net.Http.HttpClient.PostAsync(string?, HttpContent?, System.Threading.CancellationToken)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PostAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<string?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -69,8 +75,8 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PostAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<Uri?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
22 changes: 14 additions & 8 deletions Source/Mockolate/Web/HttpClientExtensions.Setup.Put.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public static partial class HttpClientExtensions
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PutAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PutAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PutAsync(
requestUri ?? It.IsAny<string?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
Expand All @@ -34,17 +37,20 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PutAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content)
=> setup.PutAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> setup.PutAsync(
requestUri ?? It.IsAny<Uri?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Setup for the method
/// <see cref="System.Net.Http.HttpClient.PutAsync(string?, HttpContent?, System.Threading.CancellationToken)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PutAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<string?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -69,8 +75,8 @@ public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, Cancell
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public IReturnMethodSetup<Task<HttpResponseMessage>, HttpRequestMessage, CancellationToken> PutAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<Uri?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (setup is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
8 changes: 4 additions & 4 deletions Source/Mockolate/Web/HttpClientExtensions.Verify.Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static partial class HttpClientExtensions
/// </summary>
public VerificationResult<HttpClient> DeleteAsync(
IParameter<string?>? requestUri)
=> verifyInvoked.DeleteAsync(requestUri, It.IsAny<CancellationToken>());
=> verifyInvoked.DeleteAsync(requestUri ?? It.IsAny<string?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
Expand All @@ -32,15 +32,15 @@ public VerificationResult<HttpClient> DeleteAsync(
/// </summary>
public VerificationResult<HttpClient> DeleteAsync(
IParameter<Uri?>? requestUri)
=> verifyInvoked.DeleteAsync(requestUri, It.IsAny<CancellationToken>());
=> verifyInvoked.DeleteAsync(requestUri ?? It.IsAny<Uri?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
/// <see cref="System.Net.Http.HttpClient.DeleteAsync(string?)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> DeleteAsync(
IParameter<string?>? requestUri,
IParameter<string?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -62,7 +62,7 @@ public VerificationResult<HttpClient> DeleteAsync(
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> DeleteAsync(
IParameter<Uri?>? requestUri,
IParameter<Uri?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
8 changes: 4 additions & 4 deletions Source/Mockolate/Web/HttpClientExtensions.Verify.Get.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static partial class HttpClientExtensions
/// </summary>
public VerificationResult<HttpClient> GetAsync(
IParameter<string?>? requestUri)
=> verifyInvoked.GetAsync(requestUri, It.IsAny<CancellationToken>());
=> verifyInvoked.GetAsync(requestUri ?? It.IsAny<string?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
Expand All @@ -32,15 +32,15 @@ public VerificationResult<HttpClient> GetAsync(
/// </summary>
public VerificationResult<HttpClient> GetAsync(
IParameter<Uri?>? requestUri)
=> verifyInvoked.GetAsync(requestUri, It.IsAny<CancellationToken>());
=> verifyInvoked.GetAsync(requestUri ?? It.IsAny<Uri?>(), It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
/// <see cref="System.Net.Http.HttpClient.GetAsync(string?)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> GetAsync(
IParameter<string?>? requestUri,
IParameter<string?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -62,7 +62,7 @@ public VerificationResult<HttpClient> GetAsync(
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> GetAsync(
IParameter<Uri?>? requestUri,
IParameter<Uri?> requestUri,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
22 changes: 14 additions & 8 deletions Source/Mockolate/Web/HttpClientExtensions.Verify.Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ public static partial class HttpClientExtensions
/// </summary>
public VerificationResult<HttpClient> PatchAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content)
=> verifyInvoked.PatchAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> verifyInvoked.PatchAsync(
requestUri ?? It.IsAny<string?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
Expand All @@ -34,17 +37,20 @@ public VerificationResult<HttpClient> PatchAsync(
/// </summary>
public VerificationResult<HttpClient> PatchAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content)
=> verifyInvoked.PatchAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> verifyInvoked.PatchAsync(
requestUri ?? It.IsAny<Uri?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
/// <see cref="System.Net.Http.HttpClient.PatchAsync(string?, HttpContent?)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> PatchAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<string?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -67,8 +73,8 @@ public VerificationResult<HttpClient> PatchAsync(
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> PatchAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<Uri?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
22 changes: 14 additions & 8 deletions Source/Mockolate/Web/HttpClientExtensions.Verify.Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ public static partial class HttpClientExtensions
/// </summary>
public VerificationResult<HttpClient> PostAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content)
=> verifyInvoked.PostAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> verifyInvoked.PostAsync(
requestUri ?? It.IsAny<string?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
Expand All @@ -33,17 +36,20 @@ public VerificationResult<HttpClient> PostAsync(
/// </summary>
public VerificationResult<HttpClient> PostAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content)
=> verifyInvoked.PostAsync(requestUri, content, It.IsAny<CancellationToken>());
IParameter<HttpContent?>? content = null)
=> verifyInvoked.PostAsync(
requestUri ?? It.IsAny<Uri?>(),
content ?? It.IsAny<HttpContent?>(),
It.IsAny<CancellationToken>());

/// <summary>
/// Validates the invocations for the method
/// <see cref="System.Net.Http.HttpClient.PostAsync(string?, HttpContent?)" />
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> PostAsync(
IParameter<string?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<string?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand All @@ -66,8 +72,8 @@ public VerificationResult<HttpClient> PostAsync(
/// with the given <paramref name="requestUri" /> and <paramref name="cancellationToken" />.
/// </summary>
public VerificationResult<HttpClient> PostAsync(
IParameter<Uri?>? requestUri,
IParameter<HttpContent?>? content,
IParameter<Uri?> requestUri,
IParameter<HttpContent?> content,
IParameter<CancellationToken> cancellationToken)
{
if (verifyInvoked is Mock<HttpClient> { ConstructorParameters.Length: > 0, } httpClientMock &&
Expand Down
Loading
Loading