Skip to content

Commit

Permalink
chore: Rename _contentFactory to _httpContentCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Aug 7, 2023
1 parent 4e5ed89 commit b665b1f
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class HttpWaitStrategy : IWaitUntil

private HttpMessageHandler _httpMessageHandler;

private Func<HttpContent> _contentFactory;
private Func<HttpContent> _httpContentCallback;

/// <summary>
/// Initializes a new instance of the <see cref="HttpWaitStrategy" /> class.
Expand Down Expand Up @@ -77,7 +77,7 @@ public async Task<bool> UntilAsync(IContainer container)
httpRequestMessage.Headers.Add(httpHeader.Key, httpHeader.Value);
}

using (httpRequestMessage.Content = _contentFactory())
using (httpRequestMessage.Content = _httpContentCallback())
{
HttpResponseMessage httpResponseMessage;

Expand Down Expand Up @@ -124,7 +124,7 @@ public async Task<bool> UntilAsync(IContainer container)
finally
{
httpResponseMessage.Dispose();
}
}
}
}
}
Expand Down Expand Up @@ -263,14 +263,14 @@ public HttpWaitStrategy WithHeaders(IReadOnlyDictionary<string, string> headers)
/// <summary>
/// Sets the HTTP message body of the HTTP request.
/// </summary>
/// <param name="contentFactory">
/// A factory to create the desired content.
/// Make sure to provide a new instance on every call, because it will be disposed on retries.
/// </param>
/// <param name="httpContentCallback">The callback to invoke to create the HTTP message body.</param>
/// <remarks>
/// It is important to create a new instance of <see cref="HttpContent" /> within the callback, the HTTP client disposes the content after each call.
/// </remarks>
/// <returns>A configured instance of <see cref="HttpWaitStrategy" />.</returns>
public HttpWaitStrategy WithContent(Func<HttpContent> contentFactory)
public HttpWaitStrategy WithContent(Func<HttpContent> httpContentCallback)
{
_contentFactory = contentFactory;
_httpContentCallback = httpContentCallback;
return this;
}
}
Expand Down

0 comments on commit b665b1f

Please sign in to comment.