コード例 #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_Context_Is_Null()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();

            // When
            var result = Record.Exception(() => TalendCommandLineAliases.BuildJob(null,
                                                                                  fixture.ProjectName, fixture.JobName, fixture.ArtifactDestination, fixture.Settings));

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("context");
        }
コード例 #3
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.");
        }
コード例 #4
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");
        }
コード例 #5
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");
        }
コード例 #6
0
        public void BuildJob_Should_Throw_If_ArtifactDestination_Is_Null()
        {
            // Given
            var fixture = new TalendCommandLineBuildJobFixture();
            var context = Substitute.For <ICakeContext>();

            // When
            var result = Record.Exception(() => TalendCommandLineAliases.BuildJob(context,
                                                                                  "Test1", "job42", null, fixture.Settings));

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("artifactDestination");
        }
コード例 #7
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).");
        }
コード例 #8
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\\\"");
        }