public void Add_Addables_to_pizza_should_throw_expected_exception_if_addable_does_not_exist() { var inputNames = new List <string>() { "Hawaii", "Fanta", "Kebabpizza" }; var controller = new OrdersController(); controller.Create(inputNames); var inputAddable = "Vacuum"; Assert.ThrowsException <ArgumentNullException>(() => controller.AddAddable(1, 2, inputAddable)); }
public void Confirm_order_should_return_list_of_ingrediens_and_products_and_price() { var inputNames = new List <string>() { "Hawaii", "Fanta", "Kebabpizza" }; var controller = new OrdersController(); controller.Create(inputNames); var inputAddable = "Kebab"; controller.AddAddable(1, 2, inputAddable); var actual = controller.Confirm(1); Assert.AreEqual(Order.OrderStatus.Confirmed, actual.Status); }
public void Add_Addables_to_pizza_should_succeed() { var inputNames = new List <string>() { "Hawaii", "Fanta", "Kebabpizza" }; var controller = new OrdersController(); controller.Create(inputNames); var inputAddable = "Kebab"; var actual = controller.Get(1); Assert.AreEqual(0, (actual.Items[2] as Pizza).Addables.Count); controller.AddAddable(1, 2, inputAddable); Assert.AreEqual(1, (actual.Items[2] as Pizza).Addables.Count); Assert.AreEqual(240, actual.TotalPrice); }