public ProductTests() { var optionsBuilder = new DbContextOptionsBuilder <ApiNetCoreContext>() .UseInMemoryDatabase(databaseName: DATABASE).Options; this.context = new ApiNetCoreContext(optionsBuilder); this.dataRepository = new ProductRepository(this.context); this.getProductByIdService = new GetProductByIdService(this.dataRepository); this.getAllProductsService = new GetAllProductsService(this.dataRepository); this.InitData(); }
public ProductRepository(ApiNetCoreContext context) { this.context = context; }