예제 #1
0
        /// <summary>
        /// test getInfo() and check result against created resp. updated customer
        /// </summary>
        /// <param name="alreadyUpdated">check result against created or updated customer</param>
        public void getInfo(bool alreadyUpdated)
        {
            string[]  customerPaths = new string[] { path + alias };
            ArrayList customers_out = serviceClient.getInfo(customerPaths, new string[] { "Comment" });

            // test if getinfo was successful and if all data are equal to input
            Assert.AreEqual(1, customers_out.Count, "get info result set");

            TGetInfo_Return customer_out = (TGetInfo_Return)customers_out.ToArray()[0];

            Assert.AreEqual(alias, customer_out.Alias, "customer alias");

            if (alreadyUpdated)
            {
                Assert.AreEqual(customer_update.BillingAddress.FirstName, customer_out.BillingAddress.FirstName, "FirstName");
                Assert.AreEqual(customer_update.BillingAddress.LastName, customer_out.BillingAddress.LastName, "LastName");
                Assert.AreEqual(customer_update.BillingAddress.Street, customer_out.BillingAddress.Street, "Street");
                Assert.AreEqual(customer_update.Attributes[0].Value, customer_out.Attributes[0].Value, "Comment");

                Assert.AreEqual(customer_update.IsDoOrderAllowed, customer_out.IsDoOrderAllowed, "IsDoOrderAllowed");
            }
            else
            {
                Assert.AreEqual(customer_in.BillingAddress.FirstName, customer_out.BillingAddress.FirstName, "FirstName");
                Assert.AreEqual(customer_in.BillingAddress.LastName, customer_out.BillingAddress.LastName, "LastName");
                Assert.AreEqual(customer_in.BillingAddress.Street, customer_out.BillingAddress.Street, "Street");
                Assert.AreEqual(customer_in.Attributes[0].Value, customer_out.Attributes[0].Value, "Comment");

                Assert.AreEqual(customer_in.IsDoOrderAllowed, customer_out.IsDoOrderAllowed, "IsDoOrderAllowed");
            }
            Assert.AreEqual(customer_in.BillingAddress.VerifiedOn, customer_out.BillingAddress.VerifiedOn, "VerifiedOn");
            Assert.AreEqual(customer_in.BillingAddress.Birthday, customer_out.BillingAddress.Birthday, "Birthday");
            Assert.AreEqual(customer_in.BillingAddress.EMail, customer_out.BillingAddress.EMail, "EMail");
        }