diff options
author | crupest <crupest@outlook.com> | 2020-01-31 22:46:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 22:46:17 +0800 |
commit | 69a5cc2a6f3282de4859d7c083bd67dfa17226fb (patch) | |
tree | f969a960472bbf828e5d639a8deef65341b52a6a /Timeline.Tests | |
parent | 3749a642306b19c84f324b0e94c4d62d8ec60332 (diff) | |
download | timeline-69a5cc2a6f3282de4859d7c083bd67dfa17226fb.tar.gz timeline-69a5cc2a6f3282de4859d7c083bd67dfa17226fb.tar.bz2 timeline-69a5cc2a6f3282de4859d7c083bd67dfa17226fb.zip |
Make all patch return the new entity.
Diffstat (limited to 'Timeline.Tests')
-rw-r--r-- | Timeline.Tests/IntegratedTests/PersonalTimelineTest.cs | 9 | ||||
-rw-r--r-- | Timeline.Tests/IntegratedTests/UserTest.cs | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Timeline.Tests/IntegratedTests/PersonalTimelineTest.cs b/Timeline.Tests/IntegratedTests/PersonalTimelineTest.cs index f3d6b172..81446fd8 100644 --- a/Timeline.Tests/IntegratedTests/PersonalTimelineTest.cs +++ b/Timeline.Tests/IntegratedTests/PersonalTimelineTest.cs @@ -119,19 +119,22 @@ namespace Timeline.Tests.IntegratedTests { var res = await client.PatchAsJsonAsync("users/user1/timeline", new TimelinePatchRequest { Description = mockDescription }); - res.Should().HaveStatusCode(200); + res.Should().HaveStatusCode(200) + .And.HaveJsonBody<BaseTimelineInfo>().Which.Description.Should().Be(mockDescription); await AssertDescription(mockDescription); } { var res = await client.PatchAsJsonAsync("users/user1/timeline", new TimelinePatchRequest { Description = null }); - res.Should().HaveStatusCode(200); + res.Should().HaveStatusCode(200) + .And.HaveJsonBody<BaseTimelineInfo>().Which.Description.Should().Be(mockDescription); await AssertDescription(mockDescription); } { var res = await client.PatchAsJsonAsync("users/user1/timeline", new TimelinePatchRequest { Description = "" }); - res.Should().HaveStatusCode(200); + res.Should().HaveStatusCode(200) + .And.HaveJsonBody<BaseTimelineInfo>().Which.Description.Should().Be(""); await AssertDescription(""); } } diff --git a/Timeline.Tests/IntegratedTests/UserTest.cs b/Timeline.Tests/IntegratedTests/UserTest.cs index f863eb6c..8ce76299 100644 --- a/Timeline.Tests/IntegratedTests/UserTest.cs +++ b/Timeline.Tests/IntegratedTests/UserTest.cs @@ -102,7 +102,9 @@ namespace Timeline.Tests.IntegratedTests {
var res = await client.PatchAsJsonAsync("/users/user1",
new UserPatchRequest { Nickname = "aaa" });
- res.Should().HaveStatusCode(200);
+ res.Should().HaveStatusCode(200)
+ .And.HaveJsonBody<UserInfo>()
+ .Which.Nickname.Should().Be("aaa");
}
{
@@ -128,7 +130,11 @@ namespace Timeline.Tests.IntegratedTests Administrator = true,
Nickname = "aaa"
});
- res.Should().HaveStatusCode(200);
+ var body = res.Should().HaveStatusCode(200)
+ .And.HaveJsonBody<UserInfo>()
+ .Which;
+ body.Administrator.Should().Be(true);
+ body.Nickname.Should().Be("aaa");
}
{
|