Пример #1
0
        public async Task Can_Add_Base_Type_Nodes_To_Inherited_Type_Pipeline()
        {
            var testNode  = new SimpleTestNodeA1();
            var testNode2 = new SimpleTestNodeASub1();

            var pipeline = new PipelineNode <TestObjectASub>();

            pipeline.AddChild(testNode);
            pipeline.AddChild(testNode2);

            var testObject = new TestObjectASub();

            var result = await pipeline.ExecuteAsync(testObject);

            testNode.Status.Should().Be(NodeRunStatus.Completed);
            result.Status.Should().Be(NodeResultStatus.Succeeded);
        }
Пример #2
0
        public async Task ShouldExecuteFunc_On_Test_Object_Is_Evaluated()
        {
            var testNode  = new SimpleTestNodeA1();
            var testNode2 = new SimpleTestNodeASub1();

            testNode2.AddShouldExecute(context => Task.FromResult(context.Subject.TestValueDecimal == 1));

            var pipeline = new PipelineNode <TestObjectASub>();

            pipeline.AddChild(testNode);
            pipeline.AddChild(testNode2);

            var testObject = new TestObjectASub();

            var result = await pipeline.ExecuteAsync(testObject);

            testNode.Status.Should().Be(NodeRunStatus.Completed);
            testNode2.Status.Should().Be(NodeRunStatus.NotRun);
        }