Exemplo n.º 1
0
        public void testCustomerSvc()
        {
            try {
                //week 3
                //ICustomerSvc ics = factory.getCustomerSvc();

                //week 4
                ICustomerSvc ics = (ICustomerSvc)factory.getService("ICustomerSvc");

                // First let's store the Customer
                Assert.True(ics.storeCustomer(c));

                // Then let's read it back in
                c = ics.getCustomer(c.id);
                Assert.True(c.validate());

                // Update customer
                c.emailAddress = "*****@*****.**";
                Assert.True(ics.storeCustomer(c));

                // Finally, let's cleanup the file that was created
                Assert.True(ics.deleteCustomer(c.id));
            }
            catch (Exception e) {
                Console.WriteLine("Exception in testStoreCustomer: " + e.Message + "\n" + e.StackTrace);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }