diff options
author | crupest <crupest@outlook.com> | 2020-08-21 23:47:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 23:47:10 +0800 |
commit | 733b8291855d1498e0ba9bc36a47a1b5f8b612ad (patch) | |
tree | 4885b9f7e828ec3f0ae7e2acacf348c9f5c158d9 /Timeline.Tests/IntegratedTests/UserAvatarTest.cs | |
parent | dc363ad8ae654af056c9ffa551008dbbf52b5d57 (diff) | |
parent | f1c70edd559c72dcb47ff647f3f03ba5ae9a56cc (diff) | |
download | timeline-733b8291855d1498e0ba9bc36a47a1b5f8b612ad.tar.gz timeline-733b8291855d1498e0ba9bc36a47a1b5f8b612ad.tar.bz2 timeline-733b8291855d1498e0ba9bc36a47a1b5f8b612ad.zip |
Merge pull request #149 from crupest/swagger
Swagger/OpenAPI
Diffstat (limited to 'Timeline.Tests/IntegratedTests/UserAvatarTest.cs')
-rw-r--r-- | Timeline.Tests/IntegratedTests/UserAvatarTest.cs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Timeline.Tests/IntegratedTests/UserAvatarTest.cs b/Timeline.Tests/IntegratedTests/UserAvatarTest.cs index 91986cda..507b05ba 100644 --- a/Timeline.Tests/IntegratedTests/UserAvatarTest.cs +++ b/Timeline.Tests/IntegratedTests/UserAvatarTest.cs @@ -66,16 +66,14 @@ namespace Timeline.Tests.IntegratedTests using var content = new ByteArrayContent(new[] { (byte)0x00 });
content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
var res = await client.PutAsync("users/user1/avatar", content);
- res.Should().HaveStatusCode(HttpStatusCode.BadRequest)
- .And.HaveCommonBody().Which.Code.Should().Be(ErrorCodes.Common.Header.ContentLength_Missing); ;
+ res.Should().BeInvalidModel();
}
{
using var content = new ByteArrayContent(new[] { (byte)0x00 });
content.Headers.ContentLength = 1;
var res = await client.PutAsync("users/user1/avatar", content);
- res.Should().HaveStatusCode(HttpStatusCode.BadRequest)
- .And.HaveCommonBody().Which.Code.Should().Be(ErrorCodes.Common.Header.ContentType_Missing);
+ res.Should().BeInvalidModel();
}
{
@@ -83,8 +81,7 @@ namespace Timeline.Tests.IntegratedTests content.Headers.ContentLength = 0;
content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
var res = await client.PutAsync("users/user1/avatar", content);
- res.Should().HaveStatusCode(HttpStatusCode.BadRequest)
- .And.HaveCommonBody().Which.Code.Should().Be(ErrorCodes.Common.Header.ContentLength_Zero);
+ res.Should().BeInvalidModel();
}
{
@@ -106,8 +103,7 @@ namespace Timeline.Tests.IntegratedTests content.Headers.ContentLength = 2;
content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
var res = await client.PutAsync("users/user1/avatar", content);
- res.Should().HaveStatusCode(HttpStatusCode.BadRequest)
- .And.HaveCommonBody().Which.Code.Should().Be(ErrorCodes.Common.Content.UnmatchedLength_Smaller);
+ res.Should().BeInvalidModel();
}
{
@@ -115,8 +111,7 @@ namespace Timeline.Tests.IntegratedTests content.Headers.ContentLength = 1;
content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
var res = await client.PutAsync("users/user1/avatar", content);
- res.Should().HaveStatusCode(HttpStatusCode.BadRequest)
- .And.HaveCommonBody().Which.Code.Should().Be(ErrorCodes.Common.Content.UnmatchedLength_Bigger);
+ res.Should().BeInvalidModel();
}
{
|