public void ApproveAnotherCustomerClearsCurrentCustomerAndRedirectsToApproveCustomerView() { MockNavigationService navigationService = new MockNavigationService(); CustomersController controller = GetCustomersControllerInitialized(navigationService); controller.CurrentCustomer = new Customer(); controller.ApproveAnotherCustomer(); Assert.IsNull(controller.CurrentCustomer); Assert.IsTrue(navigationService.NavigateCalled); Assert.AreEqual(ViewNames.ApproveCustomerView, navigationService.View); }
public void ApproveCurrentCustomerApprovesCustomerAndUpdatesDataStoreAndRedirectsToSummary() { MockNavigationService navigationService = new MockNavigationService(); List<Customer> customers = new List<Customer>(); CustomersController controller = GetCustomersControllerInitialized(navigationService, customers); Customer customerInDataStore = new Customer(1000, "Enrique", "Gil", false); customers.Add(customerInDataStore); Customer customerToApprove = new Customer(1000, "Enrique", "Gil", false); controller.CurrentCustomer = customerToApprove; controller.ApproveCurrentCustomer(); Assert.IsTrue(customerToApprove.Approved); Assert.IsTrue(customerInDataStore.Approved); Assert.IsTrue(navigationService.NavigateCalled); Assert.AreEqual(ViewNames.SummaryView, navigationService.View); }