Ejemplo n.º 1
0
        public void CreateCustomerTest()
        {
            //Arrange
            var customer = new Customer()
            {
                FirstName = "Bob", LastName = "Smith"
            };                                                                       // populate all properties

            //Act
            _repository.AddCustomer(customer);

            //Assert
            var customerId = customer.CustomerId;

            Assert.IsTrue(customerId > 0);
            ReInitRepo();
            // get customerById
            var customerFromDb = _repository.CustomerRetrieve(customerId);

            Assert.AreEqual(customer.FirstName, customerFromDb.FirstName);
            Assert.AreEqual(customer.LastName, customerFromDb.LastName);
            //TODO Check All properties
        }