diff options
author | crupest <crupest@outlook.com> | 2020-03-11 23:21:37 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-11 23:21:37 +0800 |
commit | 70af7808deca84ad2d118c5002989a98e1623450 (patch) | |
tree | 52647ce84d276ffc99447cea2f78bea050ece8a5 /Timeline.Tests | |
parent | 61a4a86c3c428cc7ca985f003fb23641d1bde2ee (diff) | |
download | timeline-70af7808deca84ad2d118c5002989a98e1623450.tar.gz timeline-70af7808deca84ad2d118c5002989a98e1623450.tar.bz2 timeline-70af7808deca84ad2d118c5002989a98e1623450.zip |
Add links test for timeline.
Diffstat (limited to 'Timeline.Tests')
-rw-r--r-- | Timeline.Tests/IntegratedTests/TimelineTest.cs | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Timeline.Tests/IntegratedTests/TimelineTest.cs b/Timeline.Tests/IntegratedTests/TimelineTest.cs index 69a04003..215dcf17 100644 --- a/Timeline.Tests/IntegratedTests/TimelineTest.cs +++ b/Timeline.Tests/IntegratedTests/TimelineTest.cs @@ -98,16 +98,36 @@ namespace Timeline.Tests.IntegratedTests }
[Fact]
- public async Task Personal_TimelineGet_Should_Work()
+ public async Task TimelineGet_Should_Work()
{
using var client = await CreateDefaultClient();
- var res = await client.GetAsync("timelines/@user1");
- var body = res.Should().HaveStatusCode(200)
- .And.HaveJsonBody<TimelineInfo>().Which;
- body.Owner.Should().BeEquivalentTo(UserInfos[1]);
- body.Visibility.Should().Be(TimelineVisibility.Register);
- body.Description.Should().Be("");
- body.Members.Should().NotBeNull().And.BeEmpty();
+ {
+ var res = await client.GetAsync("timelines/@user1");
+ var body = res.Should().HaveStatusCode(200)
+ .And.HaveJsonBody<TimelineInfo>().Which;
+ body.Owner.Should().BeEquivalentTo(UserInfos[1]);
+ body.Visibility.Should().Be(TimelineVisibility.Register);
+ body.Description.Should().Be("");
+ body.Members.Should().NotBeNull().And.BeEmpty();
+ var links = body._links;
+ links.Should().NotBeNull();
+ links.Self.Should().EndWith("/timelines/@user1");
+ links.Posts.Should().EndWith("/timelines/@user1/posts");
+ }
+
+ {
+ var res = await client.GetAsync("timelines/t1");
+ var body = res.Should().HaveStatusCode(200)
+ .And.HaveJsonBody<TimelineInfo>().Which;
+ body.Owner.Should().BeEquivalentTo(UserInfos[1]);
+ body.Visibility.Should().Be(TimelineVisibility.Register);
+ body.Description.Should().Be("");
+ body.Members.Should().NotBeNull().And.BeEmpty();
+ var links = body._links;
+ links.Should().NotBeNull();
+ links.Self.Should().EndWith("/timelines/t1");
+ links.Posts.Should().EndWith("/timelines/t1/posts");
+ }
}
[Fact]
|