Esempio n. 1
0
        public void GetCustomerById_ShouldGetCorrectCustomer()
        {
            KomodoCustomer customer1 = new KomodoCustomer(12, "Jones", 30, new DateTime(2000, 10, 3));
            KomodoCustomer customer2 = new KomodoCustomer(13, "Smith", 25, new DateTime(1995, 8, 2));

            KomodoRepo repo = new KomodoRepo();

            repo.AddCustomer(customer1);
            repo.AddCustomer(customer2);

            KomodoCustomer returnCustomer = repo.GetKomodoCustomerById(13);

            Assert.AreEqual("Smith", returnCustomer.LastName);
        }
Esempio n. 2
0
        public void AddCustomer_ShouldReturnTrue()
        {
            KomodoCustomer customer = new KomodoCustomer(12, "Jones", 30, new DateTime(2000, 10, 3));

            KomodoRepo repo = new KomodoRepo();

            bool addResult = repo.AddCustomer(customer);

            Assert.IsTrue(addResult);
        }
Esempio n. 3
0
        public void DeleteCustomer_ShouldReturnTrue()
        {
            KomodoCustomer customer1 = new KomodoCustomer(12, "Jones", 30, new DateTime(2000, 10, 3));

            KomodoRepo repo = new KomodoRepo();

            repo.AddCustomer(customer1);

            bool wasDeleted = repo.DeleteCustomerInformation(customer1);

            Assert.IsTrue(wasDeleted);
        }
Esempio n. 4
0
        public void GetCustomers_ShouldGetCorrectCustomerBase()
        {
            KomodoCustomer customer = new KomodoCustomer(12, "Jones", 30, new DateTime(2000, 10, 3));
            KomodoRepo     repo     = new KomodoRepo();

            repo.AddCustomer(customer);

            List <KomodoCustomer> customerBase = repo.GetKomodoCustomers();

            bool hasContent = customerBase.Contains(customer);

            Assert.IsTrue(hasContent);
        }
Esempio n. 5
0
        public void UpdateCustomer_ShouldReturnTrue()
        {
            KomodoCustomer customer1 = new KomodoCustomer(12, "Jones", 30, new DateTime(2000, 10, 3));

            KomodoRepo repo = new KomodoRepo();

            repo.AddCustomer(customer1);

            bool wasUpdated = repo.UpdateCustomerInformation(12, "Smith", 31);

            Assert.AreEqual(customer1.LastName, "Smith");
            Assert.AreEqual(customer1.Age, 31);
            Assert.IsTrue(wasUpdated);
        }