public async Task Failed_Node_Run_Status_Is_Failed()
        {
            var testNode = new FailingTestNodeA();

            var testObjectList = GetTestObjects();

            var result = await testNode.ExecuteManyAsync(testObjectList, new ExecutionOptions { DegreeOfParallelism = 4 });

            result.Status.Should().Be(NodeResultStatus.Failed);
            result.Exception.Should().BeNull();
            testNode.Status.Should().Be(NodeRunStatus.Completed);
        }
Example #2
0
        public async void Failed_Node_Run_Status_Is_Completed_With_Failed_Result()
        {
            var testNode = new FailingTestNodeA();

            var testObject = new TestObjectA();

            var context = new ExecutionContext <TestObjectA>(testObject);

            var result = await testNode.ExecuteAsync(context);

            testNode.Status.ShouldEqual(NodeRunStatus.Completed);
            result.Status.ShouldEqual(NodeResultStatus.Failed);
        }
Example #3
0
        public async Task Failed_Node_Run_Status_Is_Failed()
        {
            var testNode = new FailingTestNodeA();

            var testObject1 = new TestObjectA();
            var testObject2 = new TestObjectA();

            var testObjectList = new List <TestObjectA> {
                testObject1, testObject2
            };

            var result = await testNode.ExecuteManyAsync(testObjectList);

            result.Status.Should().Be(NodeResultStatus.Failed);
            result.Exception.Should().BeNull();
            testNode.Status.Should().Be(NodeRunStatus.Completed);
        }
        public async Task FirstMatch_Node_Fails_When_Selected_Node_Fails()
        {
            var matchNode = new FirstMatchNode <TestObjectA>();

            var firstNode = new FailingTestNodeA();

            matchNode.AddChild(firstNode);

            var secondNode = new SimpleTestNodeA2();

            matchNode.AddChild(secondNode);

            var        testObject = new TestObjectA();
            NodeResult result     = await matchNode.ExecuteAsync(testObject);

            matchNode.Status.Should().Be(NodeRunStatus.Completed);
            firstNode.Status.Should().Be(NodeRunStatus.Completed);
            secondNode.Status.Should().Be(NodeRunStatus.NotRun);
            result.Status.Should().Be(NodeResultStatus.Failed);

            testObject.TestValueString.Should().Be("Failed");
            testObject.TestValueInt.Should().Be(0);
        }