aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Services/TimelineServiceTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline.Tests/Services/TimelineServiceTest.cs')
-rw-r--r--Timeline.Tests/Services/TimelineServiceTest.cs8
1 files changed, 8 insertions, 0 deletions
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<ArgumentException>();
+ await _timelineService.Awaiting(s => s.ChangeTimelineName("tl", "!!!")).Should().ThrowAsync<ArgumentException>();
+ await _timelineService.Awaiting(s => s.ChangeTimelineName("tl", "newtl")).Should().ThrowAsync<TimelineNotExistException>();
+
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<EntityAlreadyExistException>();
var time = _clock.ForwardCurrentTime();