diff options
author | crupest <crupest@outlook.com> | 2021-02-02 20:26:32 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-02 20:26:32 +0800 |
commit | c9a7b944a0aa38bc44677bf62532c1811aded961 (patch) | |
tree | 78ebd697e32f87d5812a4c6a8e07957e0c364aa7 /BackEnd | |
parent | 21cf6a046b3e279c0694594f40e33daaa4d863f7 (diff) | |
download | timeline-c9a7b944a0aa38bc44677bf62532c1811aded961.tar.gz timeline-c9a7b944a0aa38bc44677bf62532c1811aded961.tar.bz2 timeline-c9a7b944a0aa38bc44677bf62532c1811aded961.zip |
test: Add timeline color test.
Diffstat (limited to 'BackEnd')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs | 24 |
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");
+ }
+ }
}
}
|