Esempio n. 1
0
        public void CustomerDelete()
        {
            var db = new TestDb();
            db.AddSet(TestData.Customers);

            // Arrange
            CustomerController controller = new CustomerController(db);
            CustomerModel testCustomer = new CustomerModel();
            testCustomer.Id = 8;
            testCustomer.Email = "*****@*****.**";
            testCustomer.FirstName = "User First Name";
            testCustomer.MiddleName = "User Middle Name";
            testCustomer.LastName = "User Last Name";
            testCustomer.Gender = "M";
            testCustomer.Address = "The World";
            testCustomer.BirthDate = DateTime.UtcNow.Date;
            testCustomer.MaritalStatus = "M";
            testCustomer.SourceOfIncome = "Employed";
            testCustomer.IsDeleted = false;
            testCustomer.CreateDate = DateTime.UtcNow.Date;
            testCustomer.UpdateDate = DateTime.UtcNow.Date;

            // Act
               // var result = controller.Delete(testCustomer);

            // Assert
            //Assert.IsNotNull(result);
        }
Esempio n. 2
0
        public void CustomerRetrieveById()
        {
            var db = new TestDb();
            var username = "******";
            db.AddSet(TestData.Customers);

            // Arrange
            CustomerController controller = new CustomerController(db);

            // Act
            var result = controller.Get(username);

            // Assert
            Assert.IsNotNull(result);
        }
Esempio n. 3
0
        public void CustomerRetrieveAll()
        {
            var db = new TestDb();
            db.AddSet(TestData.Customers);

            // Arrange
            CustomerController controller = new CustomerController(db);

            // Act
            IEnumerable<CustomerModel> result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
        }