protected void Page_Load(object sender, EventArgs e) { // Create the presenter and pass in the view (this) and our repository. (Fake DB layer) var presenter = new CheckOutPresenter(this, new CheckoutRepository()); // Use Presenter to get the Ordered list. // This binds the results to the view property 'CheckoutItems' presenter.GetItemsOrderedByPrice(); CheckoutList.DataSource = CheckoutItems; CheckoutList.DataTextField = "Description"; CheckoutList.DataBind(); // Use Presenter to get the running total. // This binds the results to the view property 'RunningTotal' presenter.GetRunningTotal(); CheckoutTotal.Text = RunningTotal.ToString(); }
public void CheckRunningTotalForBasketWithItems() { //Arrange var view = new MockedCheckOutView(); var presenter = new CheckOutPresenter(view, new MockedCheckOutRepository()); //Act presenter.GetRunningTotal(); //Assert Assert.AreEqual(8.95m, view.RunningTotal); }