///<summary> /// Returns a Typed VSalesPerson Entity with mock values. ///</summary> static public VSalesPerson CreateMockInstance() { VSalesPerson mock = new VSalesPerson(); mock.SalesPersonId = 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.JobTitle = TestUtility.Instance.RandomString(24, false);; mock.Phone = TestUtility.Instance.RandomString(11, false);; mock.EmailAddress = TestUtility.Instance.RandomString(24, false);; mock.EmailPromotion = TestUtility.Instance.RandomNumber(); 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.TerritoryName = TestUtility.Instance.RandomString(24, false);; mock.TerritoryGroup = TestUtility.Instance.RandomString(24, false);; mock.SalesQuota = TestUtility.Instance.RandomShort(); mock.SalesYtd = TestUtility.Instance.RandomShort(); mock.SalesLastYear = TestUtility.Instance.RandomShort(); return((VSalesPerson)mock); }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static VSalesPerson Convert(WsProxy.VSalesPerson item) { VSalesPerson outItem = new VSalesPerson(); outItem.SalesPersonId = item.SalesPersonId; outItem.Title = item.Title; outItem.FirstName = item.FirstName; outItem.MiddleName = item.MiddleName; outItem.LastName = item.LastName; outItem.Suffix = item.Suffix; outItem.JobTitle = item.JobTitle; outItem.Phone = item.Phone; outItem.EmailAddress = item.EmailAddress; outItem.EmailPromotion = item.EmailPromotion; 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.TerritoryName = item.TerritoryName; outItem.TerritoryGroup = item.TerritoryGroup; outItem.SalesQuota = item.SalesQuota; outItem.SalesYtd = item.SalesYtd; outItem.SalesLastYear = item.SalesLastYear; outItem.AcceptChanges(); return(outItem); }
/// <summary> /// Deserialize the mock VSalesPerson entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VSalesPerson.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VSalesPerson)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VSalesPerson)mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }