static public CreateMockInstance ( TransactionManager tm ) : |
||
tm | TransactionManager | |
Résultat |
///<summary> /// Returns a Typed SalesTerritoryHistory Entity with mock values. ///</summary> static public SalesTerritoryHistory CreateMockInstance_Generated(TransactionManager tm) { SalesTerritoryHistory mock = new SalesTerritoryHistory(); mock.StartDate = TestUtility.Instance.RandomDateTime(); mock.EndDate = TestUtility.Instance.RandomDateTime(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship SalesPerson mockSalesPersonBySalesPersonId = SalesPersonTest.CreateMockInstance(tm); DataRepository.SalesPersonProvider.Insert(tm, mockSalesPersonBySalesPersonId); mock.SalesPersonId = mockSalesPersonBySalesPersonId.SalesPersonId; //OneToOneRelationship SalesTerritory mockSalesTerritoryByTerritoryId = SalesTerritoryTest.CreateMockInstance(tm); DataRepository.SalesTerritoryProvider.Insert(tm, mockSalesTerritoryByTerritoryId); mock.TerritoryId = mockSalesTerritoryByTerritoryId.TerritoryId; // create a temporary collection and add the item to it TList <SalesTerritoryHistory> tempMockCollection = new TList <SalesTerritoryHistory>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((SalesTerritoryHistory)mock); }
///<summary> /// Update the Typed SalesPersonQuotaHistory Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, SalesPersonQuotaHistory mock) { mock.SalesQuota = TestUtility.Instance.RandomShort(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship SalesPerson mockSalesPersonBySalesPersonId = SalesPersonTest.CreateMockInstance(tm); DataRepository.SalesPersonProvider.Insert(tm, mockSalesPersonBySalesPersonId); mock.SalesPersonId = mockSalesPersonBySalesPersonId.SalesPersonId; }