Exemplo n.º 1
0
            public void ReturnTrue_WhenOneCustomerIsAdded() //WORKING
            {
                CustomerBase customerBase = new CustomerBase();

                Assert.IsTrue(customerBase.getListSize() == 0);
                Assert.IsTrue(customerBase.Add(new Customer("John", 1234)));
                Assert.IsTrue(customerBase.getListSize() == 1);
            }
Exemplo n.º 2
0
            public void ReturnTrue_WhenThreeCustomersAreAdded()   //WORKING
            {
                CustomerBase customerBase = new CustomerBase();

                Assert.IsTrue(customerBase.getListSize() == 0);
                Assert.IsTrue(customerBase.Add(new Customer("John", 4)));
                Assert.IsTrue(customerBase.Add(new Customer("Abraham", 3456)));
                Assert.IsTrue(customerBase.Add(new Customer("Isaac", 7890)));
                Assert.IsTrue(customerBase.getListSize() == 3);
            }
Exemplo n.º 3
0
            public void ReturnFalse_WhenNameIsAnEmptyStringOrNull()   //WORKING
            {
                CustomerBase customerBase = new CustomerBase();

                Assert.IsFalse(customerBase.Add(new Customer("", 4444)));
                Assert.IsFalse(customerBase.Add(new Customer(null, 2222)));
                Assert.IsTrue(customerBase.getListSize() == 0);
            }
Exemplo n.º 4
0
            public void ReturnFalse_WhenCustomerIdDoesNotExist()
            {
                CustomerBase customerBase = new CustomerBase();

                customerBase.Add(new Customer("Abraham", 8734));
                customerBase.Add(new Customer("Lincoln", 9010));
                Assert.IsFalse(customerBase.Delete(7777));
                Assert.IsTrue(customerBase.getListSize() == 2);
            }
Exemplo n.º 5
0
            public void ReturnTrue_WhenCustomerIsDeleted()
            {
                CustomerBase customerBase = new CustomerBase();

                customerBase.Add(new Customer("Joseph", 1329));
                customerBase.Add(new Customer("Brigham", 8791));
                Assert.IsTrue(customerBase.Delete(1329));
                Assert.IsTrue(customerBase.Delete(8791));
                Assert.IsTrue(customerBase.getListSize() == 0);
            }