コード例 #1
0
        public void Should_Start_Arguments_With_CommandLine_Options()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            // When
            var result = fixture.Run();

            // Then
            result.Args.ShouldStartWith(_commandLineArgumentPrefix);
        }
コード例 #2
0
        public void Should_Throw_If_Process_Was_Not_Started()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            fixture.GivenProcessCannotStart();

            // When
            var result = Record.Exception(() => fixture.Run());

            // Then
            result.ShouldBeType <CakeException>().Message.ShouldEqual("Talend Command Line: Process was not started.");
        }
コード例 #3
0
        public void Should_Throw_If_ArtifactDestination_Is_Null()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            fixture.ArtifactDestination = null;

            // When
            var result = Record.Exception(() => fixture.Run());

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("path");
        }
コード例 #4
0
        public void Should_Throw_If_Settings_Are_Null()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            fixture.Settings = null;

            // When
            var result = Record.Exception(() => fixture.Run());

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("settings");
        }
コード例 #5
0
        public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            fixture.GivenProcessExitsWithCode(1);

            // When
            var result = Record.Exception(() => fixture.Run());

            // Then
            result.ShouldBeType <CakeException>()
            .Message.ShouldEqual("Talend Command Line: Process returned an error (exit code 1).");
        }
コード例 #6
0
        public void Should_Add_BuildJobArguments()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            fixture.JobName             = "job42";
            fixture.ProjectName         = "Test1";
            fixture.Settings.User       = "******";
            fixture.ArtifactDestination = "C:/Temp";

            // When
            var result = fixture.Run();

            // Then
            result.Args.ShouldContain("initLocal;logonProject -pn Test1 -ul [email protected];buildJob job42 -dd \\\"C:/Temp\\\"");
        }