aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-02 20:26:32 +0800
committercrupest <crupest@outlook.com>2021-02-02 20:26:32 +0800
commit78b3cca725bd508e248749eb3ca5cd6f3ea0f8ec (patch)
tree0f6a96093145cb9e7369040421fadc59a7b90512
parent0a0a61b60544a135a61394953bb5bb9dbbfeb241 (diff)
downloadtimeline-78b3cca725bd508e248749eb3ca5cd6f3ea0f8ec.tar.gz
timeline-78b3cca725bd508e248749eb3ca5cd6f3ea0f8ec.tar.bz2
timeline-78b3cca725bd508e248749eb3ca5cd6f3ea0f8ec.zip
test: Add timeline color test.
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
index 28fcb9fa..ec9a6d83 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
@@ -389,5 +389,29 @@ namespace Timeline.Tests.IntegratedTests
}
}
}
+
+ [Theory]
+ [MemberData(nameof(TimelineNameGeneratorTestData))]
+ public async Task Color(TimelineNameGenerator generator)
+ {
+ using var client = await CreateClientAsUser();
+
+ {
+ var timeline = await client.TestGetAsync<HttpTimeline>($"timelines/{generator(1)}");
+ timeline.Color.Should().Be(null);
+ }
+
+ await client.TestPatchAssertInvalidModelAsync($"timelines/{generator(1)}", new HttpTimelinePatchRequest { Color = "!!!" });
+
+ {
+ var timeline = await client.TestPatchAsync<HttpTimeline>($"timelines/{generator(1)}", new HttpTimelinePatchRequest { Color = "#112233" });
+ timeline.Color.Should().Be("#112233");
+ }
+
+ {
+ var timeline = await client.TestGetAsync<HttpTimeline>($"timelines/{generator(1)}");
+ timeline.Color.Should().Be("#112233");
+ }
+ }
}
}