public void Should_Start_Arguments_With_CommandLine_Options()
        {
            // Given
            var fixture = new TalendCommandLineBuildRouteFixture();

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

            // Then
            result.Args.ShouldStartWith(_commandLineArgumentPrefix);
        }
        public void Should_Throw_If_Process_Was_Not_Started()
        {
            // Given
            var fixture = new TalendCommandLineBuildRouteFixture();

            fixture.GivenProcessCannotStart();

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

            // Then
            result.ShouldBeType <CakeException>().Message.ShouldEqual("Talend Command Line: Process was not started.");
        }
        public void Should_Throw_If_ArtifactDestination_Is_Null()
        {
            // Given
            var fixture = new TalendCommandLineBuildRouteFixture();

            fixture.ArtifactDestination = null;

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

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("path");
        }
        public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
        {
            // Given
            var fixture = new TalendCommandLineBuildRouteFixture();

            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).");
        }
        public void Should_Add_BuildRouteArguments()
        {
            // Given
            var fixture = new TalendCommandLineBuildRouteFixture();

            fixture.RouteName           = "route3";
            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];buildRoute route3 -dd \\\"C:/Temp\\\"");
        }