static public CreateMockInstance ( TransactionManager tm ) : |
||
tm | TransactionManager | |
return |
///<summary> /// Returns a Typed StoreContact Entity with mock values. ///</summary> static public StoreContact CreateMockInstance_Generated(TransactionManager tm) { StoreContact mock = new StoreContact(); 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; // create a temporary collection and add the item to it TList <StoreContact> tempMockCollection = new TList <StoreContact>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((StoreContact)mock); }
///<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; }