public async void TestGetallProducts() { DbContextOptions <CreaturesDbcontext> options = new DbContextOptionsBuilder <CreaturesDbcontext>().UseInMemoryDatabase("GetProducts").Options; using (CreaturesDbcontext context = new CreaturesDbcontext(options)) { Product p = new Product(); p.ID = 1; Product pp = new Product(); pp.ID = 2; ProductManagementService Service = new ProductManagementService(context); await Service.Create(p); await Service.Create(pp); var res = await Service.GetAllProducts(); Assert.Equal(2, res.Count); } }
public void Test03_GetAllProductsTest() { var result = _productManager.GetAllProducts(); Assert.IsTrue(result.Count() > 0); }