コード例 #1
0
        public void returns_expected_variables_when_none_has_been_defined()
        {
            var sut = PipelineFile.Parse(new[]
            {
                "dummy:",
                "   dummy",
            });

            Assert.Empty(sut.Variables);
        }
コード例 #2
0
        public void parse_simple_step_returns_expected_name_of_step(string expected)
        {
            var sut = PipelineFile.Parse(new[]
            {
                $"{expected}:",
                "   dummy",
            });

            Assert.Equal(
                expected: new[] { expected },
                actual: sut.Steps.Select(x => x.Name)
                );
        }
コード例 #3
0
        public void can_handle_multi_line_action()
        {
            var sut = PipelineFile.Parse(new[]
            {
                "foo:",
                @"   bar \",
                @"   baz \",
                @"   qux",
            });

            Assert.Equal(
                expected: new[]
            {
                new Step("foo", new[] { "bar baz qux" }),
            },
                actual: sut.Steps
                );
        }
コード例 #4
0
        public void can_handle_mix_of_single_and_multi_line_actions()
        {
            var sut = PipelineFile.Parse(new[]
            {
                "foo:",
                @"   bar",
                @"   baz1 \",
                @"   baz2",
                @"   qux",
            });

            Assert.Equal(
                expected: new[]
            {
                new Step("foo", new[] { "bar", "baz1 baz2", "qux" }),
            },
                actual: sut.Steps
                );
        }
コード例 #5
0
        public void parse_multiple_simple_steps_with_single_action_returns_expected()
        {
            var sut = PipelineFile.Parse(new[]
            {
                "foo:",
                "   bar",
                "",
                "baz:",
                "   qux",
            });

            Assert.Equal(
                expected: new[]
            {
                new Step("foo", new[] { "bar" }),
                new Step("baz", new[] { "qux" })
            },
                actual: sut.Steps
                );
        }
コード例 #6
0
        public void can_handle_comments()
        {
            var sut = PipelineFile.Parse(new[]
            {
                "# first comment",
                "foo:",
                "   bar",
                "",
                "  # second comment",
                "baz:",
                "   qux",
            });

            Assert.Equal(
                expected: new[]
            {
                new Step("foo", new[] { "bar" }),
                new Step("baz", new[] { "qux" })
            },
                actual: sut.Steps
                );
        }