Exemple #1
0
        public void CustomerAccount_Test()
        {
            CustomerAccount custAccount1 = CustomerAccountsExtension.CreateCustomerAccount("Jose Guingao III", "wla lang");

            CustomerAccountAddress address1 = custAccount1.AddCustomerAddress("Camaman-an", "Jose Guingao III", "0915548857", "wala lang");
            CustomerAccountAddress address2 = custAccount1.AddCustomerAddress("Camaman-an2", "Jose Guingao III2", "09155488572", "wala lang2");

            linkWebDB.CustomerAccounts.Add(custAccount1);
            linkWebDB.CustomerAccountAddresses.Add(address1);
            linkWebDB.CustomerAccountAddresses.Add(address2);

            linkWebDB.SaveChanges();

            Assert.AreEqual(custAccount1.GUID, linkWebDB.CustomerAccounts.FirstOrDefault().GUID);
            Assert.AreEqual(address2.GUID, linkWebDB.CustomerAccounts.FirstOrDefault().CustomerAccountAddresses.ElementAt(1).GUID);
            Assert.AreEqual(address1.GUID, linkWebDB.CustomerAccounts.FirstOrDefault().CustomerAccountAddresses.ElementAt(0).GUID);
        }