diff options
author | crupest <crupest@outlook.com> | 2020-11-15 16:50:01 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-15 16:50:01 +0800 |
commit | 10d7b5aab88701bfe76c33c0573bec596cca297a (patch) | |
tree | 056a0fcab5e50ada521475ed4e4293fe4446cb42 /BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs | |
parent | f9a2e795207287db997d0b00eef0893d99f388e0 (diff) | |
download | timeline-10d7b5aab88701bfe76c33c0573bec596cca297a.tar.gz timeline-10d7b5aab88701bfe76c33c0573bec596cca297a.tar.bz2 timeline-10d7b5aab88701bfe76c33c0573bec596cca297a.zip |
...
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs index 3d85c2ae..cd884c5e 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs @@ -146,6 +146,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Post, url, jsonBody);
}
+ public static async Task TestPutAssertInvalidModelAsync(this HttpClient client, string url, object? jsonBody = null)
+ {
+ await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Put, url, jsonBody);
+ }
+
public static async Task TestDeleteAssertInvalidModelAsync(this HttpClient client, string url, object? jsonBody = null)
{
await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Delete, url, jsonBody);
@@ -201,6 +206,16 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertNotFoundAsync(HttpMethod.Get, url, jsonBody, errorCode, headerSetup);
}
+ public static async Task TestPutAssertNotFoundAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null)
+ {
+ await client.TestJsonSendAssertNotFoundAsync(HttpMethod.Put, url, jsonBody, errorCode, headerSetup);
+ }
+
+ public static async Task TestDeleteAssertNotFoundAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null)
+ {
+ await client.TestJsonSendAssertNotFoundAsync(HttpMethod.Delete, url, jsonBody, errorCode, headerSetup);
+ }
+
public static async Task<HttpResponseMessage> TestPutByteArrayAsync(this HttpClient client, string url, byte[] body, string mimeType, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
using var content = new ByteArrayContent(body);
|