/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static VIndividualCustomer Convert(WsProxy.VIndividualCustomer item) { VIndividualCustomer outItem = new VIndividualCustomer(); outItem.CustomerId = item.CustomerId; outItem.Title = item.Title; outItem.FirstName = item.FirstName; outItem.MiddleName = item.MiddleName; outItem.LastName = item.LastName; outItem.Suffix = item.Suffix; outItem.Phone = item.Phone; outItem.EmailAddress = item.EmailAddress; outItem.EmailPromotion = item.EmailPromotion; outItem.AddressType = item.AddressType; outItem.AddressLine1 = item.AddressLine1; outItem.AddressLine2 = item.AddressLine2; outItem.City = item.City; outItem.StateProvinceName = item.StateProvinceName; outItem.PostalCode = item.PostalCode; outItem.CountryRegionName = item.CountryRegionName; outItem.Demographics = item.Demographics; outItem.AcceptChanges(); return(outItem); }
/// <summary> /// Deserialize the mock VIndividualCustomer entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VIndividualCustomer.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VIndividualCustomer)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VIndividualCustomer)mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
///<summary> /// Returns a Typed VIndividualCustomer Entity with mock values. ///</summary> static public VIndividualCustomer CreateMockInstance() { VIndividualCustomer mock = new VIndividualCustomer(); mock.CustomerId = TestUtility.Instance.RandomNumber(); mock.Title = TestUtility.Instance.RandomString(8, false);; mock.FirstName = TestUtility.Instance.RandomString(24, false);; mock.MiddleName = TestUtility.Instance.RandomString(24, false);; mock.LastName = TestUtility.Instance.RandomString(24, false);; mock.Suffix = TestUtility.Instance.RandomString(10, false);; mock.Phone = TestUtility.Instance.RandomString(11, false);; mock.EmailAddress = TestUtility.Instance.RandomString(24, false);; mock.EmailPromotion = TestUtility.Instance.RandomNumber(); mock.AddressType = TestUtility.Instance.RandomString(24, false);; mock.AddressLine1 = TestUtility.Instance.RandomString(29, false);; mock.AddressLine2 = TestUtility.Instance.RandomString(29, false);; mock.City = TestUtility.Instance.RandomString(14, false);; mock.StateProvinceName = TestUtility.Instance.RandomString(24, false);; mock.PostalCode = TestUtility.Instance.RandomString(6, false);; mock.CountryRegionName = TestUtility.Instance.RandomString(24, false);; mock.Demographics = "<test></test>"; return((VIndividualCustomer)mock); }