static public CreateMockInstance ( TransactionManager tm ) : WorkOrder | ||
tm | TransactionManager | |
Résultat | WorkOrder |
///<summary> /// Returns a Typed WorkOrderRouting Entity with mock values. ///</summary> static public WorkOrderRouting CreateMockInstance_Generated(TransactionManager tm) { WorkOrderRouting mock = new WorkOrderRouting(); mock.ProductId = TestUtility.Instance.RandomNumber(); mock.OperationSequence = TestUtility.Instance.RandomShort(); mock.ScheduledStartDate = TestUtility.Instance.RandomDateTime(); mock.ScheduledEndDate = TestUtility.Instance.RandomDateTime(); mock.ActualStartDate = TestUtility.Instance.RandomDateTime(); mock.ActualEndDate = TestUtility.Instance.RandomDateTime(); mock.ActualResourceHrs = (decimal)TestUtility.Instance.RandomShort(); mock.PlannedCost = TestUtility.Instance.RandomShort(); mock.ActualCost = TestUtility.Instance.RandomShort(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Location mockLocationByLocationId = LocationTest.CreateMockInstance(tm); DataRepository.LocationProvider.Insert(tm, mockLocationByLocationId); mock.LocationId = mockLocationByLocationId.LocationId; //OneToOneRelationship WorkOrder mockWorkOrderByWorkOrderId = WorkOrderTest.CreateMockInstance(tm); DataRepository.WorkOrderProvider.Insert(tm, mockWorkOrderByWorkOrderId); mock.WorkOrderId = mockWorkOrderByWorkOrderId.WorkOrderId; // create a temporary collection and add the item to it TList <WorkOrderRouting> tempMockCollection = new TList <WorkOrderRouting>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((WorkOrderRouting)mock); }
///<summary> /// Update the Typed WorkOrderRouting Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, WorkOrderRouting mock) { mock.ScheduledStartDate = TestUtility.Instance.RandomDateTime(); mock.ScheduledEndDate = TestUtility.Instance.RandomDateTime(); mock.ActualStartDate = TestUtility.Instance.RandomDateTime(); mock.ActualEndDate = TestUtility.Instance.RandomDateTime(); mock.ActualResourceHrs = (decimal)TestUtility.Instance.RandomShort(); mock.PlannedCost = TestUtility.Instance.RandomShort(); mock.ActualCost = TestUtility.Instance.RandomShort(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship Location mockLocationByLocationId = LocationTest.CreateMockInstance(tm); DataRepository.LocationProvider.Insert(tm, mockLocationByLocationId); mock.LocationId = mockLocationByLocationId.LocationId; //OneToOneRelationship WorkOrder mockWorkOrderByWorkOrderId = WorkOrderTest.CreateMockInstance(tm); DataRepository.WorkOrderProvider.Insert(tm, mockWorkOrderByWorkOrderId); mock.WorkOrderId = mockWorkOrderByWorkOrderId.WorkOrderId; }