diff options
author | crupest <crupest@outlook.com> | 2020-08-21 22:49:48 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-21 22:49:48 +0800 |
commit | 4475de3c0c86c4096b843d8bee8aff48b7e31896 (patch) | |
tree | debe06900073c0855b3a72c13dce00bbff8aa189 /Timeline.Tests/IntegratedTests/UserAvatarTest.cs | |
parent | dcb0a10e1adaec24961f2484e7f9a9a1f1f5da15 (diff) | |
download | timeline-4475de3c0c86c4096b843d8bee8aff48b7e31896.tar.gz timeline-4475de3c0c86c4096b843d8bee8aff48b7e31896.tar.bz2 timeline-4475de3c0c86c4096b843d8bee8aff48b7e31896.zip |
...
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();
}
{
|