From a46460a3cc71497bc7d360ab3d7068059bc7a0cc Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Feb 2021 21:26:01 +0800 Subject: ... --- .../IntegratedTests/TimelinePostTest.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'BackEnd/Timeline.Tests') diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs index ae7afda1..f05ed7af 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs @@ -473,5 +473,32 @@ namespace Timeline.Tests.IntegratedTests } } + [Theory] + [MemberData(nameof(TimelineNameGeneratorTestData))] + public async Task Color(TimelineNameGenerator generator) + { + using var client = await CreateClientAsUser(); + + HttpTimelinePostCreateRequestContent CreateRequestContent() => new() + { + Type = "text", + Text = "aaa" + }; + + await client.TestPostAssertInvalidModelAsync($"timelines/{generator(1)}/posts", new HttpTimelinePostCreateRequest + { + Content = CreateRequestContent(), + Color = "#1" + }); + + { + var post = await client.TestPostAsync($"timelines/{generator(1)}/posts", new HttpTimelinePostCreateRequest + { + Content = CreateRequestContent(), + Color = "#aabbcc" + }); + post.Color.Should().Be("#aabbcc"); + } + } } } -- cgit v1.2.3