public static FuhoDbContext Create() { var _dateTimeProvider = new Mock <IDateTimeProvider>(); var _currentUserService = new Mock <ICurrentUserService>(); _dateTimeProvider.Setup(x => x.Now).Returns(DateTime.Now); _currentUserService.Setup(x => x.UserId).Returns("a56b856f-e009-4cfa-9f87-58f04f573617"); var options = new DbContextOptionsBuilder <FuhoDbContext>() .UseInMemoryDatabase("FuhoInMemoryDataBase") .Options; var context = new FuhoDbContext(options, _dateTimeProvider.Object, _currentUserService.Object); context.Database.EnsureCreated(); return(context); }
public CreateProductHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; _fileSystemService = fixture.FileSystemService; }
public GetAllCategoriesHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; }
public CreateCommentHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; }
public GetCommentByProductIdHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; _logger = fixture.CreateLoggerMock <GetCategoryByIdHandler>(); }
public CreateCategoryHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; _mapper = fixture.Mapper; }
public CommandTestBase() { _fuhoDbContext = FuhoContextFactory.Create(); }
public GetAllProductsHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; }
public UpdateProductHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; _fileSystemService = fixture.FileSystemService; _logger = fixture.CreateLoggerMock <UpdateProductHandler>(); }
public UpdateCategoryHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; _logger = fixture.CreateLoggerMock <UpdateCategoryHandler>(); }
public static void Destroy(FuhoDbContext context) { context.Database.EnsureDeleted(); context.Dispose(); }
public RemoveProductHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; }
public RemoveCategoryHandlerTest(QueryTestFixture fixture) { _fuhoDbContext = fixture.FuhoDbContext; }