public CategoriesControllerTest() { var options = new DbContextOptionsBuilder <WebShopContext>() .UseInMemoryDatabase("TestDb") .Options; _context = new WebShopContext(options); TestDbInitializer.Initialize(_context); _service = new WebShopServices(_context); _controller = new CategoriesController(_service); }
public ProductsControllerTest() { var options = new DbContextOptionsBuilder <WebShopContext>() .EnableSensitiveDataLogging() .UseInMemoryDatabase("TestDb") .Options; _context = new WebShopContext(options); TestDbInitializer.Initialize(_context); _service = new WebShopServices(_context); _controller = new ProductsController(_service); }