From e9e9bfa551949226b0d82969c7cc8e8c0b6d44dc Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 2 Nov 2023 08:02:48 +0300 Subject: [PATCH] Fixes broken tests --- .../Middleware/RedirectHandlerTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Microsoft.Kiota.Http.HttpClientLibrary.Tests/Middleware/RedirectHandlerTests.cs b/Microsoft.Kiota.Http.HttpClientLibrary.Tests/Middleware/RedirectHandlerTests.cs index e191302..afe6242 100644 --- a/Microsoft.Kiota.Http.HttpClientLibrary.Tests/Middleware/RedirectHandlerTests.cs +++ b/Microsoft.Kiota.Http.HttpClientLibrary.Tests/Middleware/RedirectHandlerTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -161,7 +161,7 @@ public async Task RedirectWithDifferentSchemeThrowsInvalidOperationExceptionIfAl redirectResponse.Headers.Location = new Uri("http://example.org/bar"); this._testHttpMessageHandler.SetHttpResponse(redirectResponse, new HttpResponseMessage(HttpStatusCode.OK));// sets the mock response // Act - var exception = await Assert.ThrowsAsync(async () => await this._invoker.SendAsync(httpRequestMessage, CancellationToken.None)); + var exception = await Assert.ThrowsAsync(() => this._invoker.SendAsync(httpRequestMessage, CancellationToken.None)); // Assert Assert.Contains("Redirects with changing schemes not allowed by default", exception.Message); Assert.Equal("Scheme changed from https to http.", exception.InnerException?.Message); @@ -233,7 +233,7 @@ public async Task ExceedMaxRedirectsShouldThrowsException() response2.Headers.Location = new Uri("http://example.org/foo"); this._testHttpMessageHandler.SetHttpResponse(response1, response2);// sets the mock response // Act - var exception = await Assert.ThrowsAsync(async () => await this._invoker.SendAsync( + var exception = await Assert.ThrowsAsync(() => this._invoker.SendAsync( httpRequestMessage, CancellationToken.None)); // Assert Assert.Equal("Too many redirects performed", exception.Message);