public void AddCustomerTest() { //Arrange IPersistentCustomerDataHandler cdh = new FakeCustomerDataHandler(); CreateCustomerViewModel createCustomerViewModel = new CreateCustomerViewModel(cdh); //Act cdh.Customers = cdh.GetAllCustomers(); int noOfCustomers = cdh.Customers.Count; createCustomerViewModel.CustomerName = "Mig"; createCustomerViewModel.AddNewCustomer(); //Assert Assert.AreEqual(noOfCustomers + 1, cdh.Customers.Count); }
public void AddCustomerTest() { //Arrange IPersistentCustomerDataHandler fakeHandler = new FakeCustomerDataHandler(); IBaseCustomer newTestCustomer = new Customer { CustomerName = "Mig" }; //Act Customers = fakeHandler.GetAllCustomers(); int noOfCustomers = Customers.Count; Customers.Add(newTestCustomer); //Assert Assert.AreEqual(noOfCustomers + 1, Customers.Count); }