/// <summary> /// Deserialize the mock VIndividualDemographics entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VIndividualDemographics.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VIndividualDemographics)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VIndividualDemographics)mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.VIndividualDemographics Convert(VIndividualDemographics item) { WsProxy.VIndividualDemographics outItem = new WsProxy.VIndividualDemographics(); outItem.CustomerId = item.CustomerId; outItem.TotalPurchaseYtd = item.TotalPurchaseYtd; outItem.DateFirstPurchase = item.DateFirstPurchase; outItem.BirthDate = item.BirthDate; outItem.MaritalStatus = item.MaritalStatus; outItem.YearlyIncome = item.YearlyIncome; outItem.Gender = item.Gender; outItem.TotalChildren = item.TotalChildren; outItem.NumberChildrenAtHome = item.NumberChildrenAtHome; outItem.Education = item.Education; outItem.Occupation = item.Occupation; outItem.HomeOwnerFlag = item.HomeOwnerFlag; outItem.NumberCarsOwned = item.NumberCarsOwned; return(outItem); }
///<summary> /// Returns a Typed VIndividualDemographics Entity with mock values. ///</summary> static public VIndividualDemographics CreateMockInstance() { VIndividualDemographics mock = new VIndividualDemographics(); mock.CustomerId = TestUtility.Instance.RandomNumber(); mock.TotalPurchaseYtd = TestUtility.Instance.RandomShort(); mock.DateFirstPurchase = TestUtility.Instance.RandomDateTime(); mock.BirthDate = TestUtility.Instance.RandomDateTime(); mock.MaritalStatus = TestUtility.Instance.RandomString(1, false);; mock.YearlyIncome = TestUtility.Instance.RandomString(14, false);; mock.Gender = TestUtility.Instance.RandomString(1, false);; mock.TotalChildren = TestUtility.Instance.RandomNumber(); mock.NumberChildrenAtHome = TestUtility.Instance.RandomNumber(); mock.Education = TestUtility.Instance.RandomString(14, false);; mock.Occupation = TestUtility.Instance.RandomString(14, false);; mock.HomeOwnerFlag = TestUtility.Instance.RandomBoolean(); mock.NumberCarsOwned = TestUtility.Instance.RandomNumber(); return((VIndividualDemographics)mock); }