From b665b1f150cac0b0c5c9cf571592e35fed55d794 Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:26:40 +0200 Subject: [PATCH] chore: Rename _contentFactory to _httpContentCallback --- .../WaitStrategies/HttpWaitStrategy.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Testcontainers/Configurations/WaitStrategies/HttpWaitStrategy.cs b/src/Testcontainers/Configurations/WaitStrategies/HttpWaitStrategy.cs index b86eba9f4..3f457177d 100644 --- a/src/Testcontainers/Configurations/WaitStrategies/HttpWaitStrategy.cs +++ b/src/Testcontainers/Configurations/WaitStrategies/HttpWaitStrategy.cs @@ -38,7 +38,7 @@ public sealed class HttpWaitStrategy : IWaitUntil private HttpMessageHandler _httpMessageHandler; - private Func _contentFactory; + private Func _httpContentCallback; /// /// Initializes a new instance of the class. @@ -77,7 +77,7 @@ public async Task UntilAsync(IContainer container) httpRequestMessage.Headers.Add(httpHeader.Key, httpHeader.Value); } - using (httpRequestMessage.Content = _contentFactory()) + using (httpRequestMessage.Content = _httpContentCallback()) { HttpResponseMessage httpResponseMessage; @@ -124,7 +124,7 @@ public async Task UntilAsync(IContainer container) finally { httpResponseMessage.Dispose(); - } + } } } } @@ -263,14 +263,14 @@ public HttpWaitStrategy WithHeaders(IReadOnlyDictionary headers) /// /// Sets the HTTP message body of the HTTP request. /// - /// - /// A factory to create the desired content. - /// Make sure to provide a new instance on every call, because it will be disposed on retries. - /// + /// The callback to invoke to create the HTTP message body. + /// + /// It is important to create a new instance of within the callback, the HTTP client disposes the content after each call. + /// /// A configured instance of . - public HttpWaitStrategy WithContent(Func contentFactory) + public HttpWaitStrategy WithContent(Func httpContentCallback) { - _contentFactory = contentFactory; + _httpContentCallback = httpContentCallback; return this; } }