diff options
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs index 19ad315e..73ab35f2 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs @@ -29,6 +29,31 @@ namespace Timeline.Tests.IntegratedTests2 a.Name.Should().Be(b.Name); a.UniqueId.Should().Be(b.UniqueId); } + + [Fact] + public async Task CreateSameName() + { + using var client = CreateClientAsUser(); + await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Post, "v2/timelines", new HttpTimelineCreateRequest + { + Name = "hello" + }, expectedStatusCode: HttpStatusCode.Created); + + await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Post, "v2/timelines", new HttpTimelineCreateRequest + { + Name = "hello" + }, expectedStatusCode: HttpStatusCode.UnprocessableEntity); + } + + [Fact] + public async Task CreateInvalid() + { + using var client = CreateClientAsUser(); + await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Post, "v2/timelines", new HttpTimelineCreateRequest + { + Name = "!!!" + }, expectedStatusCode: HttpStatusCode.UnprocessableEntity); + } } } |