Last active
January 3, 2020 21:12
-
-
Save ankitvijay/bad3612b9c157e2e398efc2965d6a999 to your computer and use it in GitHub Desktop.
Integration Tests - Approach 2 (Project AWS.IntegrationTests)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestStartup : Common.IntegrationTests.TestStartup | |
{ | |
public override IServiceProvider ConfigureServices(IServiceCollection services) | |
{ | |
var configuration = new ConfigurationBuilder() | |
.SetBasePath(Directory.GetCurrentDirectory()) | |
.AddJsonFile("appsettings.aws.json", false) | |
.AddEnvironmentVariables() | |
.Build(); | |
services.AddMvc() | |
.SetCompatibilityVersion(version: CompatibilityVersion.Version_2_2); | |
// Code to add required services based on configuration | |
return services.BuildServiceProvider(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestServerFixture : Fixtures.TestServerFixture | |
{ | |
public TestServerFixture() : base(new TestStartup()) | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyTest : Common.IntegrationTests.MyTests, IClassFixture<TestServerFixture> | |
{ | |
public MyTest(TestServerFixture fixture) : base(fixture) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment