From 03f1df804d74685ccb121fa93719aa24496b1361 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 15 Nov 2020 17:07:34 +0800 Subject: ... --- .../IntegratedTests/HttpClientTestExtensions.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs') diff --git a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs index cd884c5e..9abe4b6b 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs @@ -121,6 +121,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertErrorAsync(HttpMethod.Put, url, jsonBody, expectedStatusCode, errorCode, headerSetup); } + public static async Task TestPatchAssertErrorAsync(this HttpClient client, string url, object? jsonBody = null, HttpStatusCode expectedStatusCode = HttpStatusCode.BadRequest, int? errorCode = null, HeaderSetup? headerSetup = null) + { + await client.TestJsonSendAssertErrorAsync(HttpMethod.Patch, url, jsonBody, expectedStatusCode, errorCode, headerSetup); + } + public static async Task TestDeleteAssertErrorAsync(this HttpClient client, string url, object? jsonBody = null, HttpStatusCode expectedStatusCode = HttpStatusCode.BadRequest, int? errorCode = null, HeaderSetup? headerSetup = null) { await client.TestJsonSendAssertErrorAsync(HttpMethod.Delete, url, jsonBody, expectedStatusCode, errorCode, headerSetup); @@ -151,6 +156,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Put, url, jsonBody); } + public static async Task TestPatchAssertInvalidModelAsync(this HttpClient client, string url, object? jsonBody = null) + { + await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Patch, url, jsonBody); + } + public static async Task TestDeleteAssertInvalidModelAsync(this HttpClient client, string url, object? jsonBody = null) { await client.TestJsonSendAssertInvalidModelAsync(HttpMethod.Delete, url, jsonBody); @@ -171,6 +181,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertUnauthorizedAsync(HttpMethod.Post, url, jsonBody, errorCode, headerSetup); } + public static async Task TestPatchAssertUnauthorizedAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null) + { + await client.TestJsonSendAssertUnauthorizedAsync(HttpMethod.Patch, url, jsonBody, errorCode, headerSetup); + } + public static async Task TestDeleteAssertUnauthorizedAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null) { await client.TestJsonSendAssertUnauthorizedAsync(HttpMethod.Delete, url, jsonBody, errorCode, headerSetup); @@ -191,6 +206,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertForbiddenAsync(HttpMethod.Post, url, jsonBody, errorCode, headerSetup); } + public static async Task TestPatchAssertForbiddenAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null) + { + await client.TestJsonSendAssertForbiddenAsync(HttpMethod.Patch, url, jsonBody, errorCode, headerSetup); + } + public static async Task TestDeleteAssertForbiddenAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null) { await client.TestJsonSendAssertForbiddenAsync(HttpMethod.Delete, url, jsonBody, errorCode, headerSetup); @@ -211,6 +231,11 @@ namespace Timeline.Tests.IntegratedTests await client.TestJsonSendAssertNotFoundAsync(HttpMethod.Put, url, jsonBody, errorCode, headerSetup); } + public static async Task TestPatchAssertNotFoundAsync(this HttpClient client, string url, object? jsonBody = null, int? errorCode = null, HeaderSetup? headerSetup = null) + { + await client.TestJsonSendAssertNotFoundAsync(HttpMethod.Patch, 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); -- cgit v1.2.3