Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }