public void returns_expected_variables_when_none_has_been_defined() { var sut = PipelineFile.Parse(new[] { "dummy:", " dummy", }); Assert.Empty(sut.Variables); }
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) ); }
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 ); }
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 ); }
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 ); }
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 ); }