Esempio n. 1
0
        public void ShouldCreateCachedExecutionPlan()
        {
            var stringWriter = new StringWriter();

            var behaviors = new IBehavior[]
            {
                new StageFork("stagefork1", stringWriter),
                new Behavior1("behavior1", stringWriter),
                new Stage1("stage1", stringWriter),
                new Behavior2("behavior2", stringWriter),
                new Stage2("stage2", stringWriter),
                new Terminator("terminator", stringWriter),
            };

            var expressions = new List <Expression>();

            behaviors.CreatePipelineExecutionExpression(expressions);

#if NET5_0_OR_GREATER
            // System.Threading.Tasks.Task has changed to System.Threading.Tasks.Task`1[System.Threading.Tasks.VoidTaskResult] in .net5
            // This ifdef is to make sure the new type is only validated for .net5 or greater.
            var scenario = "net5";
#else
            var scenario = string.Empty;
#endif

            Approver.Verify(expressions.PrettyPrint(), scenario: scenario);
        }
Esempio n. 2
0
        public void ShouldCreateCachedExecutionPlan()
        {
            if (Environment.OSVersion.Platform != PlatformID.Win32NT)
            {
                Assert.Ignore("ApprovalTests only works on Windows");
            }

            var stringWriter = new StringWriter();

            var behaviors = new IBehavior[]
            {
                new StageFork("stagefork1", stringWriter),
                new Behavior1("behavior1", stringWriter),
                new Stage1("stage1", stringWriter),
                new Behavior2("behavior2", stringWriter),
                new Stage2("stage2", stringWriter),
                new Terminator("terminator", stringWriter),
            };

            var expressions = new List <Expression>();

            behaviors.CreatePipelineExecutionExpression(expressions);

            TestApprover.Verify(expressions.PrettyPrint());
        }
Esempio n. 3
0
        public void ShouldCreateCachedExecutionPlan()
        {
            var stringWriter = new StringWriter();

            var behaviors = new IBehavior[]
            {
                new StageFork("stagefork1", stringWriter),
                new Behavior1("behavior1", stringWriter),
                new Stage1("stage1", stringWriter),
                new Behavior2("behavior2", stringWriter),
                new Stage2("stage2", stringWriter),
                new Terminator("terminator", stringWriter),
            };

            var expressions = new List <Expression>();

            behaviors.CreatePipelineExecutionExpression(expressions);

            Approvals.Verify(expressions.PrettyPrint());
        }