public async void CanDeleteProductFromDatabase() { DbContextOptions <StoreDbContext> options = new DbContextOptionsBuilder <StoreDbContext>() .UseInMemoryDatabase("CanDeleteProductFromDatabase") .Options; using StoreDbContext context = new StoreDbContext(options); InventoryManagement service = new InventoryManagement(context, _image, _config); Product dog = new Product() { Name = "Rampage2", Age = 20, Breed = "American Bull Dog", Color = "Brindle", Description = "Absolutely is an attention hog. He will chill and hang out with you all day and love life. He enjoys the outdoors " + "from sunbathing in the backyard to going for long walks. Is very obedient and will let you clean his ears, brush ", Price = 200000, SuperPower = "Super Speed", }; Assert.Equal(0, context.Products.CountAsync().Result); var result = await service.CreateProduct(dog); var actual = context.Products.FindAsync(result.Id).Result; Assert.Equal(1, context.Products.CountAsync().Result); var delete = service.DeleteProduct(result.Id); Assert.Equal(0, context.Products.CountAsync().Result); }