///<summary> /// Returns a Typed VendorContact Entity with mock values. ///</summary> static public VendorContact CreateMockInstance_Generated(TransactionManager tm) { VendorContact mock = new VendorContact(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Contact mockContactByContactId = ContactTest.CreateMockInstance(tm); DataRepository.ContactProvider.Insert(tm, mockContactByContactId); mock.ContactId = mockContactByContactId.ContactId; //OneToOneRelationship ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm); DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId); mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId; //OneToOneRelationship Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm); DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId); mock.VendorId = mockVendorByVendorId.VendorId; // create a temporary collection and add the item to it TList <VendorContact> tempMockCollection = new TList <VendorContact>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((VendorContact)mock); }
///<summary> /// Update the Typed ContactType Entity with modified mock values. ///</summary> static public void UpdateMockInstance(TransactionManager tm, ContactType mock) { ContactTypeTest.UpdateMockInstance_Generated(tm, mock); // make any alterations necessary // (i.e. for DB check constraints, special test cases, etc.) SetSpecialTestData(mock); }
///<summary> /// Returns a Typed ContactType Entity with mock values. ///</summary> static public ContactType CreateMockInstance(TransactionManager tm) { // get the default mock instance ContactType mock = ContactTypeTest.CreateMockInstance_Generated(tm); // make any alterations necessary // (i.e. for DB check constraints, special test cases, etc.) SetSpecialTestData(mock); // return the modified object return(mock); }
///<summary> /// Update the Typed VendorContact Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, VendorContact mock) { mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Contact mockContactByContactId = ContactTest.CreateMockInstance(tm); DataRepository.ContactProvider.Insert(tm, mockContactByContactId); mock.ContactId = mockContactByContactId.ContactId; //OneToOneRelationship ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm); DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId); mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId; //OneToOneRelationship Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm); DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId); mock.VendorId = mockVendorByVendorId.VendorId; }
///<summary> /// Update the Typed StoreContact Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, StoreContact mock) { mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Contact mockContactByContactId = ContactTest.CreateMockInstance(tm); DataRepository.ContactProvider.Insert(tm, mockContactByContactId); mock.ContactId = mockContactByContactId.ContactId; //OneToOneRelationship ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm); DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId); mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId; //OneToOneRelationship Store mockStoreByCustomerId = StoreTest.CreateMockInstance(tm); DataRepository.StoreProvider.Insert(tm, mockStoreByCustomerId); mock.CustomerId = mockStoreByCustomerId.CustomerId; }