aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-15 17:27:18 +0800
committercrupest <crupest@outlook.com>2020-11-15 17:27:18 +0800
commit68ace2c77bffb2e35422d4ca5d878962475ae765 (patch)
tree03bdb92126b716daab2fe7a4ab74d4a86c7c8aa4 /BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
parenta2e196289834d1a9566013b1043eee4535a2369f (diff)
downloadtimeline-68ace2c77bffb2e35422d4ca5d878962475ae765.tar.gz
timeline-68ace2c77bffb2e35422d4ca5d878962475ae765.tar.bz2
timeline-68ace2c77bffb2e35422d4ca5d878962475ae765.zip
...
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
index 9abe4b6b..7cff0c39 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTestExtensions.cs
@@ -85,9 +85,15 @@ namespace Timeline.Tests.IntegratedTests
public static async Task TestDeleteAsync(this HttpClient client, string url, bool? delete = null, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
- var body = await client.TestJsonSendAsync<CommonDeleteResponse>(HttpMethod.Delete, url, expectedStatusCode: expectedStatusCode);
if (delete.HasValue)
+ {
+ var body = await client.TestJsonSendAsync<CommonDeleteResponse>(HttpMethod.Delete, url, expectedStatusCode: expectedStatusCode);
body.Data.Delete.Should().Be(delete.Value);
+ }
+ else
+ {
+ await client.TestJsonSendAsync(HttpMethod.Delete, url, expectedStatusCode: expectedStatusCode);
+ }
}
public static async Task TestSendAssertErrorAsync(this HttpClient client, HttpMethod method, string url, HttpContent? body = null, HttpStatusCode expectedStatusCode = HttpStatusCode.BadRequest, int? errorCode = null, HeaderSetup? headerSetup = null)