aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-15 16:50:01 +0800
committercrupest <crupest@outlook.com>2020-11-15 16:50:01 +0800
commit10d7b5aab88701bfe76c33c0573bec596cca297a (patch)
tree056a0fcab5e50ada521475ed4e4293fe4446cb42 /BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
parentf9a2e795207287db997d0b00eef0893d99f388e0 (diff)
downloadtimeline-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.cs15
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);