-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestSuiteFixture.cs
More file actions
executable file
·38 lines (35 loc) · 1.56 KB
/
TestSuiteFixture.cs
File metadata and controls
executable file
·38 lines (35 loc) · 1.56 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
using System;
using System.IO;
using ConfIT;
using ConfIT.Contract;
using ConfIT.Server.Http;
namespace User.IntegrationTests
{
public class TestSuiteFixture
{
public TestSuiteFixture()
{
Environment.SetEnvironmentVariable("RUN_POOLS", "multilevel");
Environment.SetEnvironmentVariable("RUN_TESTS", "ShouldCreateAUser,ShouldCreateAUser_v1,ShouldCreateAUser_v2");
SuiteConfig = new SuiteConfig
{
ApiResponseFolder = "ApiResponses",
RequestBodyFolder = "TestCase/Request",
ResponseBodyFolder = "TestCase/Response",
ApiServerUrl = "http://localhost:5170"
};
TestHttpClient = TestHttpClient.Create(SuiteConfig.ApiServerUrl, new AuthTokenProvider());
TestProcessFactory = TestProcessor.TestProcessorFactory.Create(SuiteConfig);
// if we want to run few tests by names or by tags, if we pass those values in filter
Filter = TestFilter.CreateForTagsFromEnvVariable("RUN_POOLS");
// Filter = TestFilter.CreateForTestsFromEnvVariable("RUN_TESTS");
CreateDirectoryForResponse(SuiteConfig.ApiResponseFolder);
}
public TestHttpClient TestHttpClient { get; }
public SuiteConfig SuiteConfig { get; }
public ITestProcessorFactory TestProcessFactory { get; }
public TestFilter Filter { get; }
private void CreateDirectoryForResponse(string folder) =>
Directory.CreateDirectory(Environment.CurrentDirectory + $"/{folder}");
}
}