blob: 173494c8898746244fce2210fed61a7efe3c262c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Models.Http;
using Xunit.Abstractions;
namespace Timeline.Tests.IntegratedTests
{
public class BaseTimelineTest : IntegratedTestBase
{
public BaseTimelineTest(ITestOutputHelper testOutputHelper) : base(3, testOutputHelper)
{
}
protected override async Task OnInitializeAsync()
{
for (int i = 0; i <= 3; i++)
{
using var client = await CreateClientAs(i);
await client.TestPostAsync("timelines", new HttpTimelineCreateRequest { 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) };
}
}
}
|