コード例 #1
0
ファイル: UnitFailureTests.cs プロジェクト: ewin66/SCOUT_NS
        //[Test]
        public void when_the_fp_error_code_is_deleted_it_should_be_reset_to_the_first_fail_code()
        {
            RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>();
            InventoryItem       item    = Xpo.CreateXPObject <InventoryItem>();

            process.Item = item;

            ServiceCode firstCode = Xpo.CreateXPObject <ServiceCode>();

            process.AddFailure(firstCode, "first");

            ServiceCode secondCode = Xpo.CreateXPObject <ServiceCode>();

            process.AddFailure(secondCode, "delete_me");

            //process.ChangeFpErrorCode(1);

            process.AllProcessFailures.Remove(process.Failures[1]);

            Assert.That(process.Failures[0].IsFpErrorCode);
        }
コード例 #2
0
ファイル: UnitFailureTests.cs プロジェクト: ewin66/SCOUT_NS
        public void when_the_first_failure_is_added_to_the_collection_it_is_set_to_the_fp_error_code()
        {
            RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>();
            InventoryItem       item    = Xpo.CreateXPObject <InventoryItem>();

            process.Item = item;

            ServiceCode         serviceCode = Xpo.CreateXPObject <ServiceCode>();
            RouteStationFailure firstFailure;

            firstFailure = process.AddFailure(serviceCode, "test");
            Assert.That(firstFailure.IsFpErrorCode);
        }
コード例 #3
0
ファイル: UnitFailureTests.cs プロジェクト: ewin66/SCOUT_NS
        public void the_fp_error_code_should_be_allowed_to_change_to_a_different_fail_code()
        {
            RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>();
            InventoryItem       item    = Xpo.CreateXPObject <InventoryItem>();

            process.Item = item;

            ServiceCode         firstCode = Xpo.CreateXPObject <ServiceCode>();
            RouteStationFailure firstFailure;

            firstFailure = process.AddFailure(firstCode, "first");

            Assert.That(firstFailure.IsFpErrorCode, "The first failure was not set to the fp error code!");

            ServiceCode         secondCode = Xpo.CreateXPObject <ServiceCode>();
            RouteStationFailure shouldBeFpFailure;

            shouldBeFpFailure = process.AddFailure(secondCode, "should_be_fp");

            process.ChangeFpErrorCodeOwner(shouldBeFpFailure);

            Assert.That(shouldBeFpFailure.IsFpErrorCode, "Changing of the fp error code did not succeed!");
            Assert.That(firstFailure.IsFpErrorCode == false, "The previous fp error code owner was not relieved!");
        }
コード例 #4
0
 private void CodeByCategoryReturnHandler(object sender, ServiceCodeEventArgs serviceCodeEventArgs)
 {
     m_process.AddFailure(serviceCodeEventArgs.Code, serviceCodeEventArgs.Comments);
 }