Provides tests for the and WorkOrder objects (entity, collection and repository).
Esempio n. 1
0
        ///<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);
        }
Esempio n. 2
0
        ///<summary>
        ///  Update the Typed WorkOrder Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, WorkOrder mock)
        {
            WorkOrderTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
Esempio n. 3
0
        ///<summary>
        ///  Returns a Typed WorkOrder Entity with mock values.
        ///</summary>
        static public WorkOrder CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            WorkOrder mock = WorkOrderTest.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);
        }
Esempio n. 4
0
        ///<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;
        }