diff --git a/TestGenerator.IntegrationTesting.Backend/BaseTest.cs b/TestGenerator.IntegrationTesting.Backend/BaseTest.cs new file mode 100644 index 00000000..9829350e --- /dev/null +++ b/TestGenerator.IntegrationTesting.Backend/BaseTest.cs @@ -0,0 +1,45 @@ +using Microsoft.Extensions.DependencyInjection; +using TestDataGenerator; +using TestGenerator.IntegrationTesting.Backend.Fixtures; +using Xunit; +using Xunit.Abstractions; + +namespace TestGenerator.IntegrationTesting.Backend; + +public abstract class BaseTest // : IClassFixture, IClassFixture + where T : ScenarioGenerator +{ + protected readonly BtmsClient Client; + protected readonly TestGeneratorFixture TestGeneratorFixture; + protected readonly BackendFixture BackendFixture; + // internal readonly BackendGeneratorFixture BackendGeneratorFixture; + protected readonly ITestOutputHelper TestOutputHelper; + + protected readonly List LoadedData; + protected BaseTest( + ITestOutputHelper testOutputHelper + ) + { + TestOutputHelper = testOutputHelper; + + TestGeneratorFixture = new TestGeneratorFixture(); + BackendFixture = new BackendFixture(testOutputHelper, GetType().Name); + + // BackendFixture.TestOutputHelper = testOutputHelper; + // BackendFixture.DatabaseName = GetType().Name; + // BackendFixture.Init(GetType().Name); + + Client = BackendFixture.BtmsClient; + + var data = TestGeneratorFixture.GenerateTestData(); + LoadedData = BackendFixture + .LoadTestData(data) + .GetAwaiter() + .GetResult(); + } + + protected async Task ClearDb() + { + await Client.ClearDb(); + } +} \ No newline at end of file