From 7936281edc1ac592cd318b8dccb37f3c4e7334e8 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 27 Aug 2020 01:13:31 +0800 Subject: Timeline title feature. --- Timeline.Tests/Services/TimelineServiceTest.cs | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs') 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"); + } + } } } -- cgit v1.2.3