aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Services/TimelineServiceTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-27 01:13:31 +0800
committercrupest <crupest@outlook.com>2020-08-27 01:13:31 +0800
commit35f6584f47676353733f1cc9182d84ed4ded5cbc (patch)
tree45d959bc12082a8b4f6b084697030b34517707d1 /Timeline.Tests/Services/TimelineServiceTest.cs
parent7a974f5284f19e7b2248f633bcbd5e263aeddf81 (diff)
downloadtimeline-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.cs27
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");
+ }
+ }
}
}