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 | 0ac02cec6885094f52a41eaabcfaa0ef748a36a6 (patch) | |
tree | 388541e4efe1f97d9264e0a689522413757502e2 /BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs | |
parent | 14fd5c370a61e86eff9328649514e9161061f887 (diff) | |
download | timeline-0ac02cec6885094f52a41eaabcfaa0ef748a36a6.tar.gz timeline-0ac02cec6885094f52a41eaabcfaa0ef748a36a6.tar.bz2 timeline-0ac02cec6885094f52a41eaabcfaa0ef748a36a6.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);
|