Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Fixes broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Nov 2, 2023
1 parent 92a7a5d commit e9e9bfa
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down Expand Up @@ -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<InvalidOperationException>(async () => await this._invoker.SendAsync(httpRequestMessage, CancellationToken.None));
var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => 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);
Expand Down Expand Up @@ -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<InvalidOperationException>(async () => await this._invoker.SendAsync(
var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => this._invoker.SendAsync(
httpRequestMessage, CancellationToken.None));
// Assert
Assert.Equal("Too many redirects performed", exception.Message);
Expand Down

0 comments on commit e9e9bfa

Please sign in to comment.