-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from pieterh/develop
Develop
- Loading branch information
Showing
54 changed files
with
185 additions
and
80 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
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
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
32 changes: 32 additions & 0 deletions
32
backend/EMS.WebHost.Integration.Tests/HttpClientExtensions.cs
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities; | ||
|
||
namespace EMS.WebHost.Integration.Tests | ||
{ | ||
public static class HttpClientExtensions | ||
{ | ||
public static Task<HttpResponseMessage> OptionsAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) => | ||
OptionsAsync(client, CreateUri(requestUri)); | ||
public static Task<HttpResponseMessage> OptionsAsync(this HttpClient client, Uri? requestUri) => | ||
OptionsAsync(client, requestUri, CancellationToken.None); | ||
public static Task<HttpResponseMessage> OptionsAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) => | ||
OptionsAsync(client, CreateUri(requestUri), cancellationToken); | ||
|
||
[SuppressMessage("", "CA2000")] | ||
[SuppressMessage("", "CA1062")] | ||
public static Task<HttpResponseMessage> OptionsAsync(this HttpClient client, Uri? requestUri, CancellationToken cancellationToken) | ||
{ | ||
HttpRequestMessage request = CreateRequestMessage(HttpMethod.Options, requestUri); | ||
return client.SendAsync(request, cancellationToken); | ||
} | ||
|
||
#region Private Helpers | ||
private static Uri? CreateUri(string? uri) => | ||
string.IsNullOrEmpty(uri) ? null : new Uri(uri, UriKind.RelativeOrAbsolute); | ||
private static HttpRequestMessage CreateRequestMessage(HttpMethod method, Uri? uri) => | ||
new HttpRequestMessage(method, uri) { }; | ||
#endregion Private Helpers | ||
} | ||
} | ||
|
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
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
global using Xunit; | ||
global using FluentAssertions; |
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.