示例#1
0
        public void Add_Customer_Updates_Customers_With_Expected_Value()
        {
            var ds          = new DataStore();
            var newCustomer = new Customer
            {
                Address     = "100 High Street, Portsmouth",
                DateOfBirth = new DateTime(1950, 1, 1),
                Name        = "Martin Peters"
            };

            var customer = ds.AddCustomer(newCustomer);

            var addedCustomer    = ds.GetCustomer(customer.ID);
            var addedBankAccount = ds.GetAccount(addedCustomer.AccountNumber);

            Assert.Equal(customer.ID, addedCustomer.ID);
            Assert.Equal(newCustomer.Address, addedCustomer.Address);
            Assert.Equal(newCustomer.DateOfBirth, addedCustomer.DateOfBirth);
            Assert.Equal(newCustomer.Name, addedCustomer.Name);

            Assert.Equal(0, addedBankAccount.Transactions.Count);
            Assert.True(addedBankAccount.IsActive);
        }