From 315a5fa6eea7511618266877fca6aa1275caed1c Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 28 Aug 2020 00:01:04 +0800 Subject: Add change timeline name api to timeline controller. --- Timeline.Tests/Services/TimelineServiceTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs') diff --git a/Timeline.Tests/Services/TimelineServiceTest.cs b/Timeline.Tests/Services/TimelineServiceTest.cs index 3883cda9..5a774b78 100644 --- a/Timeline.Tests/Services/TimelineServiceTest.cs +++ b/Timeline.Tests/Services/TimelineServiceTest.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Timeline.Entities; using Timeline.Models; using Timeline.Services; +using Timeline.Services.Exceptions; using Timeline.Tests.Helpers; using Xunit; @@ -304,7 +305,14 @@ namespace Timeline.Tests.Services { _clock.ForwardCurrentTime(); + await _timelineService.Awaiting(s => s.ChangeTimelineName("!!!", "newtl")).Should().ThrowAsync(); + await _timelineService.Awaiting(s => s.ChangeTimelineName("tl", "!!!")).Should().ThrowAsync(); + await _timelineService.Awaiting(s => s.ChangeTimelineName("tl", "newtl")).Should().ThrowAsync(); + await _timelineService.CreateTimeline("tl", await _userService.GetUserIdByUsername("user")); + await _timelineService.CreateTimeline("tl2", await _userService.GetUserIdByUsername("user")); + + await _timelineService.Awaiting(s => s.ChangeTimelineName("tl", "tl2")).Should().ThrowAsync(); var time = _clock.ForwardCurrentTime(); -- cgit v1.2.3