Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The TestStartup class provides all globally registered services for our tests.
- public class TestStartup : Startup
- {
- public TestStartup(IConfiguration configuration)
- : base(configuration)
- {
- }
- public void ConfigureTestServices(IServiceCollection services)
- {
- // Register all web application services.
- base.ConfigureServices(services);
- // Replace all custom services which need mocks.
- services.ReplaceTransient<IDateTimeProvider>(_ => DateTimeProviderMock.Create);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement