public async void ItShouldCreateAProduct() { //Given EFCoreProductRepository productRepo = new EFCoreProductRepository(ctx); //When await productRepo.Add(mockProduct); //Then Product actualProduct = (await productRepo.GetAll()).ElementAt(0); Assert.Equal("product", actualProduct.Name); }
public async void ItShouldRemoveAProduct() { //Given EFCoreProductRepository productRepo = new EFCoreProductRepository(ctx); //When await productRepo.Add(mockProduct); Product tempProduct = (await productRepo.GetAll()).ElementAt(0); await productRepo.Delete(tempProduct.ID); //Then Assert.Equal(0, (await productRepo.GetAll()).Count()); }