-
-
Save michaeltnguyen/f4f36e1d92661b60fa1183bc5cb8760b to your computer and use it in GitHub Desktop.
Overridden startup for integration test
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
/// <summary> | |
/// A startup class that bypasses oauth authentication for use in | |
/// integration tests and turns off application insights. | |
/// </summary> | |
public class LocalAuthStartup : Startup | |
{ | |
public LocalAuthStartup(IConfiguration configuration) : base(configuration) | |
{ | |
} | |
protected override void ConfigureAuth(IServiceCollection services) | |
{ | |
// override the base jwt authentication with our local authorization. | |
// don't want a dependency on identity server under test | |
services.AddLocalAuthentication(); | |
} | |
protected override void ConfigureAppInsights(IServiceCollection services) | |
{ | |
// override the base implementation with nothing. We don't want | |
// telemetry under test | |
} | |
protected override void ConfigureDependencies(IServiceCollection services) | |
{ | |
services.AddSingleton(new Mock<IDatabaseManager>(MockBehavior.Strict).Object); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment