From bdff6f0ad414f1ec1352d1d4e36c78e06e02ab80 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 27 Aug 2020 23:20:14 +0800 Subject: Timeline service add change timeline name api. --- Timeline.Tests/Services/TimelineServiceTest.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs') diff --git a/Timeline.Tests/Services/TimelineServiceTest.cs b/Timeline.Tests/Services/TimelineServiceTest.cs index 558ec597..3883cda9 100644 --- a/Timeline.Tests/Services/TimelineServiceTest.cs +++ b/Timeline.Tests/Services/TimelineServiceTest.cs @@ -298,5 +298,24 @@ namespace Timeline.Tests.Services timeline.Title.Should().Be("atitle"); } } + + [Fact] + public async Task ChangeName() + { + _clock.ForwardCurrentTime(); + + await _timelineService.CreateTimeline("tl", await _userService.GetUserIdByUsername("user")); + + var time = _clock.ForwardCurrentTime(); + + await _timelineService.ChangeTimelineName("tl", "newtl"); + + { + var timeline = await _timelineService.GetTimeline("newtl"); + timeline.Name.Should().Be("newtl"); + timeline.LastModified.Should().Be(time); + timeline.NameLastModified.Should().Be(time); + } + } } } -- cgit v1.2.3