aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-07 21:50:37 +0800
committercrupest <crupest@outlook.com>2021-01-07 21:50:37 +0800
commit532c6ccd3498a0daabb3d6dbe3f0348f4b2d6a1f (patch)
treef2a9f8f74cc520063832f776d935f7c9a61d9674 /BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs
parent1a44a615ad79054218d493f8bc4bf8563201002b (diff)
downloadtimeline-532c6ccd3498a0daabb3d6dbe3f0348f4b2d6a1f.tar.gz
timeline-532c6ccd3498a0daabb3d6dbe3f0348f4b2d6a1f.tar.bz2
timeline-532c6ccd3498a0daabb3d6dbe3f0348f4b2d6a1f.zip
chore: Split integrated tests to speed up tests.
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs
new file mode 100644
index 00000000..0bf3b2b2
--- /dev/null
+++ b/BackEnd/Timeline.Tests/IntegratedTests/BaseTimelineTest.cs
@@ -0,0 +1,32 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Timeline.Models.Http;
+
+namespace Timeline.Tests.IntegratedTests
+{
+ public class BaseTimelineTest : IntegratedTestBase
+ {
+ public BaseTimelineTest() : base(3)
+ {
+ }
+
+ protected override async Task OnInitializeAsync()
+ {
+ for (int i = 0; i <= 3; i++)
+ {
+ using var client = await CreateClientAs(i);
+ await client.TestPostAsync("timelines", new TimelineCreateRequest { Name = $"t{i}" });
+ }
+ }
+
+ public static string CreatePersonalTimelineName(int i) => i == 0 ? "@admin" : $"@user{i}";
+ public static string CreateOrdinaryTimelineName(int i) => $"t{i}";
+ public delegate string TimelineNameGenerator(int i);
+
+ public static IEnumerable<object[]> TimelineNameGeneratorTestData()
+ {
+ yield return new object[] { new TimelineNameGenerator(CreatePersonalTimelineName) };
+ yield return new object[] { new TimelineNameGenerator(CreateOrdinaryTimelineName) };
+ }
+ }
+}