-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking change: IRestClient.InvokeAsync() now accepts a factory of H…
…ttpContent, which allows to work-around an issue with certain versions of .NET Standard and .NET Framework (dotnet/runtime#14612) Fixed an issue which prevented MultiplexedRestClient to properly retry HTTP invocations on failures Fixed an issue with IAsyncEnumerable support on .NET Core 3.1 (was mistakenly disabled in previous releases) Improved the way we throw `OperationCanceledException`s in several code paths Improved unit tests
- Loading branch information
Showing
87 changed files
with
199 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
@@ -32,6 +32,7 @@ | |
using System; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Flurl.Http.Testing; | ||
using Verifalia.Api.Exceptions; | ||
|
@@ -60,7 +61,22 @@ public async Task ShouldThrowServiceUnreachableExceptionWhenAllEndpointsReturnSe | |
} | ||
|
||
[Fact] | ||
public async Task ShouldThrowServiceUnreachableExceptionWhenAllEndpointsTimeOut() | ||
public async Task ShouldThrowServiceUnreachableExceptionWhenAllEndpointsFail() | ||
{ | ||
using (var httpTest = new HttpTest()) | ||
{ | ||
// Two subsequent calls should result in a server error 5xx | ||
|
||
httpTest.RespondWith("Internal server error", 500); | ||
httpTest.RespondWith("Internal server error", 500); | ||
|
||
var client = new MultiplexedRestClient(_authenticator, "dummy", new[] { new Uri("https://dummy1"), new Uri("https://dummy2") }); | ||
await Assert.ThrowsAsync<ServiceUnreachableException>(async () => await client.InvokeAsync(HttpMethod.Get, "dummy")); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task ShouldThrowServiceUnreachableExceptionWhenAllEndpointsTimeout() | ||
{ | ||
using (var httpTest = new HttpTest()) | ||
{ | ||
|
@@ -75,7 +91,18 @@ public async Task ShouldThrowServiceUnreachableExceptionWhenAllEndpointsTimeOut( | |
} | ||
|
||
[Fact] | ||
public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotReturnServerError() | ||
public async Task ShouldThrowOperationCanceledExceptionWhenCanceledWithCancellationToken() | ||
{ | ||
using (var httpTest = new HttpTest()) | ||
{ | ||
var ct = new CancellationToken(true); | ||
var client = new MultiplexedRestClient(_authenticator, "dummy", new[] { new Uri("https://dummy1"), new Uri("https://dummy2") }); | ||
await Assert.ThrowsAsync<OperationCanceledException>(async () => await client.InvokeAsync(HttpMethod.Get, "dummy", cancellationToken: ct)); | ||
} | ||
} | ||
|
||
[Fact] | ||
public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotFail() | ||
{ | ||
using (var httpTest = new HttpTest()) | ||
{ | ||
|
@@ -91,7 +118,7 @@ public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotReturnServerError() | |
} | ||
|
||
[Fact] | ||
public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotTimeOut() | ||
public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotTimeout() | ||
{ | ||
using (var httpTest = new HttpTest()) | ||
{ | ||
|
@@ -105,8 +132,7 @@ public async Task ShouldSucceedWhenAtLeastOneEndpointDoesNotTimeOut() | |
Assert.Equal(HttpStatusCode.OK, response.StatusCode); | ||
} | ||
} | ||
|
||
|
||
|
||
[Fact] | ||
public async Task ShouldImmediatelyFailOnForbiddenError() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
@@ -68,7 +68,7 @@ public async Task ShouldHandleQueryOfInProgressJobs() | |
overview = new | ||
{ | ||
id = validationId, | ||
status = "in-progress" | ||
status = "InProgress" | ||
} | ||
}, 202); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* https://verifalia.com/ | ||
* [email protected] | ||
* | ||
* Copyright (c) 2005-2020 Cobisi Research | ||
* Copyright (c) 2005-2021 Cobisi Research | ||
* | ||
* Cobisi Research | ||
* Via Della Costituzione, 31 | ||
|
Oops, something went wrong.