Advertisement
ivaylokenov

Untitled

Nov 18th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. // The TestStartup class provides all globally registered services for our tests.
  2. public class TestStartup : Startup
  3. {
  4.         public TestStartup(IConfiguration configuration)
  5.             : base(configuration)
  6.         {
  7.         }
  8.  
  9.         public void ConfigureTestServices(IServiceCollection services)
  10.         {
  11.             // Register all web application services.
  12.             base.ConfigureServices(services);
  13.  
  14.             // Replace all custom services which need mocks.
  15.             services.ReplaceTransient<IDateTimeProvider>(_ => DateTimeProviderMock.Create);
  16.         }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement