static public CreateMockInstance ( TransactionManager tm ) : |
||
tm | TransactionManager | |
return |
///<summary> /// Returns a Typed VendorAddress Entity with mock values. ///</summary> static public VendorAddress CreateMockInstance_Generated(TransactionManager tm) { VendorAddress mock = new VendorAddress(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm); DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId); mock.AddressId = mockAddressByAddressId.AddressId; //OneToOneRelationship AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm); DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId); mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId; //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 <VendorAddress> tempMockCollection = new TList <VendorAddress>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((VendorAddress)mock); }
///<summary> /// Update the Typed VendorAddress Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, VendorAddress mock) { mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm); DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId); mock.AddressId = mockAddressByAddressId.AddressId; //OneToOneRelationship AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm); DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId); mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId; //OneToOneRelationship Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm); DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId); mock.VendorId = mockVendorByVendorId.VendorId; }