public async void CanGetProductFromDatabase() { DbContextOptions <StoreDbContext> options = new DbContextOptionsBuilder <StoreDbContext>() .UseInMemoryDatabase("CanGetProductFromDatabase") .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 = service.GetProduct(result.Id).Result; Assert.Equal(1, context.Products.CountAsync().Result); // Assert.IsType<Games>(actual); Assert.Equal(1, actual.Id); Assert.Equal("Rampage2", actual.Name); }