public EventInvokerInterceptorTests() { _ServiceProvider = new ServiceCollection() .AddMediatR(typeof(SharedTestResources.Application.Anchor)) .AddScoped <IInterceptor, EventInvokerInterceptor>() .AddScoped(provider => TestDbContext.CreateContext(Guid.NewGuid().ToString(), interceptors: provider.GetServices <IInterceptor>())) .BuildServiceProvider(); }
public AggregateRootValidatorInterceptorTests() { var serviceProvider = new ServiceCollection() .AddMediatR(typeof(SharedTestResources.Application.Anchor)) .AddScoped <IInterceptor, AggregateRootValidatorInterceptor>() .AddScoped(provider => TestDbContext.CreateContext(Guid.NewGuid().ToString(), interceptors: provider.GetServices <IInterceptor>())) .BuildServiceProvider(); _Context = serviceProvider.GetRequiredService <TestDbContext>(); }
public EntityFrameworkUnitOfWorkTests() { _ServiceProvider = new ServiceCollection() .AddMediatR(typeof(SharedTestResources.Application.Anchor)) .AddScoped(provider => TestDbContext.CreateContext(Guid.NewGuid().ToString())) .AddScoped <ITestUnitOfWork, TestUnitOfWork>() .AddScoped <IRepositoryAsync <TestAggregateRoot, Guid>, TestAggregateRootRepository2>() .BuildServiceProvider(); _Context = _ServiceProvider.GetRequiredService <TestDbContext>(); }
public EntityFrameworkUnitOfWorkTests() { _FakeLogger = new FakeLogger(); var loggerFactory = Mock.Of <ILoggerFactory>(); var factoryMock = Mock.Get(loggerFactory); factoryMock.Setup(f => f.CreateLogger(It.IsAny <string>())) .Returns(_FakeLogger); _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString(), loggerFactory); }
public AggregateRootValidatorInterceptorTests() { _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString(), interceptors: new IInterceptor[] { new AggregateRootValidatorInterceptor() }); }
public RepositoryAsyncTest() { _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString()); }
public EntityTypeBuilderExtensionTests() { _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString()); }
public EventInvokerInterceptorTests() { _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString()); }
public OwnedNavigationBuilderExtensionTests() { _Context = TestDbContext.CreateContext(Guid.NewGuid().ToString()); }