public void ShouldSubmitOrderItemsToControllerOnSave() { OrderItemLine line1 = new OrderItemLine(1, "1234-56789", "#2 Pencil Pack", 1.99m, 10, 19.9m, false); OrderItemLine line2 = new OrderItemLine(2, "9876-54321", "Stencil Pad", .79m, 10, 7.9m, false); view.OrderItemsLines.Add(line1); view.OrderItemsLines.Add(line2); presenter.OnSave(); Assert.IsTrue(controller.SaveCurrentOrderAsDraftCalled); Assert.AreEqual(2, controller.CurrentOrder.Details.Count); Assert.AreEqual(1, controller.CurrentOrder.Details[0].ProductId); Assert.AreEqual(2, controller.CurrentOrder.Details[1].ProductId); }
protected void SaveButton_Click(object sender, EventArgs e) { UpdateRowIfInEditMode(); _presenter.OnSave(); }