diff options
author | crupest <crupest@outlook.com> | 2020-08-27 01:13:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-08-27 01:13:31 +0800 |
commit | 35f6584f47676353733f1cc9182d84ed4ded5cbc (patch) | |
tree | 45d959bc12082a8b4f6b084697030b34517707d1 /Timeline.Tests/Services/TimelineServiceTest.cs | |
parent | 7a974f5284f19e7b2248f633bcbd5e263aeddf81 (diff) | |
download | timeline-35f6584f47676353733f1cc9182d84ed4ded5cbc.tar.gz timeline-35f6584f47676353733f1cc9182d84ed4ded5cbc.tar.bz2 timeline-35f6584f47676353733f1cc9182d84ed4ded5cbc.zip |
Timeline title feature.
Diffstat (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs')
-rw-r--r-- | Timeline.Tests/Services/TimelineServiceTest.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Timeline.Tests/Services/TimelineServiceTest.cs b/Timeline.Tests/Services/TimelineServiceTest.cs index 36e5ed0c..558ec597 100644 --- a/Timeline.Tests/Services/TimelineServiceTest.cs +++ b/Timeline.Tests/Services/TimelineServiceTest.cs @@ -271,5 +271,32 @@ namespace Timeline.Tests.Services posts.Should().HaveCount(4);
}
}
+
+ [Theory]
+ [InlineData("@admin")]
+ [InlineData("tl")]
+ public async Task Title(string timelineName)
+ {
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, await _userService.GetUserIdByUsername("user"));
+
+ {
+ var timeline = await _timelineService.GetTimeline(timelineName);
+ timeline.Title.Should().Be(timelineName);
+ }
+
+ {
+ await _timelineService.ChangeProperty(timelineName, new TimelineChangePropertyRequest { Title = null });
+ var timeline = await _timelineService.GetTimeline(timelineName);
+ timeline.Title.Should().Be(timelineName);
+ }
+
+ {
+ await _timelineService.ChangeProperty(timelineName, new TimelineChangePropertyRequest { Title = "atitle" });
+ var timeline = await _timelineService.GetTimeline(timelineName);
+ timeline.Title.Should().Be("atitle");
+ }
+ }
}
}
|