public void GetItemPrice_Margherita_Extra_Ingredient_Returns_Correct_Price() { //Arrange var price = 89; var extraIngredientPrice = 10; var item = new CartItem { CartItemId = 1, DishId = 1, Price = price, CartId = Guid.NewGuid(), Quantity = 1, CartItemIngredients = new List <CartItemIngredient> { new CartItemIngredient { CartItemId = 1, IngredientName = "Cheese", IsOriginalIngredient = true, Price = 0 }, new CartItemIngredient { CartItemId = 1, IngredientName = "Tomato Sauce", IsOriginalIngredient = true, Price = 0 }, new CartItemIngredient { CartItemId = 1, IngredientName = "Ham", IsOriginalIngredient = false, Price = extraIngredientPrice } } }; var dbOptions = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase("Test") .Options; var dbContext = new ApplicationDbContext(dbOptions); var cartItemService = new CartItemService(dbContext); //Act var result = cartItemService.GetItemPrice(item); //Assert Assert.Equal(result, price + extraIngredientPrice); }