Template
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Strata.ContinuousImprovement.Biz.DbContexts;
|
|
using Strata.ContinuousImprovement.Api.Test.Integration.Setup;
|
|
using Strata.ContinuousImprovement.Api.Test.Integration.Tests;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
[ExcludeFromCodeCoverage]
|
|
[SetUpFixture]
|
|
public class ClientIntegrationTestFixture
|
|
{
|
|
[OneTimeSetUp]
|
|
public virtual async Task SetDbContextAndServices()
|
|
{
|
|
#if DEBUG
|
|
//When running locally sets the profile to the CI profile so you have access to resources
|
|
Environment.SetEnvironmentVariable("AWS_Profile", "sdt-continuous-improvement-service-role");
|
|
#endif
|
|
var clientService = new ApiTestBase();
|
|
await clientService.ClientValidation();
|
|
var services = ServiceCollectionFactory.Create();
|
|
await services.SetupServiceProperties(clientService.StrataId);
|
|
}
|
|
|
|
[OneTimeTearDown]
|
|
public async Task TearDown()
|
|
{
|
|
try
|
|
{
|
|
var centralDbContext = ServiceProperties.CentralDbContext as CentralDbContext;
|
|
if (centralDbContext == null) { return; }
|
|
_ = await centralDbContext.Database.EnsureDeletedAsync(CancellationToken.None);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
}
|