-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUserIntegrationTests.cs
More file actions
executable file
·45 lines (40 loc) · 1.48 KB
/
UserIntegrationTests.cs
File metadata and controls
executable file
·45 lines (40 loc) · 1.48 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
using System.Collections.Generic;
using System.Threading.Tasks;
using ConfIT;
using ConfIT.Extension;
using Newtonsoft.Json.Linq;
using Xunit;
using Xunit.Abstractions;
using ConfIT.Util;
namespace User.IntegrationTests
{
public class UserIntegrationTests : BaseTest, IClassFixture<TestSuiteFixture>
{
public UserIntegrationTests(TestSuiteFixture fixture, ITestOutputHelper output)
: base(fixture.TestHttpClient,
fixture.SuiteConfig,
fixture.TestProcessFactory,
new TestOutputLogger(output),
fixture.Filter)
{
}
[Theory]
[MemberData(nameof(GetTestCasesForFolder), "TestCase")]
public async Task ExecuteTest(string testName, JContainer test) =>
await Execute(testName, test.ToTestCase(Config.RequestBodyFolder, Config.ResponseBodyFolder));
/// <summary>
/// Use this to read tests from a single file
/// </summary>
/// <param name="fileName"></param>
/// <param name="testName"></param>
/// <returns></returns>
public static IEnumerable<object[]> GetTestCases(string fileName) =>
TestReader.GetTestsForAFile(fileName, "TestCase");
/// <summary>
/// Use this to read tests from a folder
/// </summary>
/// <returns></returns>
public static IEnumerable<object[]> GetTestCasesForFolder(string folder) =>
TestReader.GetTestsForAFolder(folder);
}
}