public void Should_Add_Mandatory_Arguments_When_Using_Token()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.UseToken();

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

                // Then
                Assert.Equal("export --token \"token\" " +
                             "-o \"repoOwner\" -r \"repo\" " +
                             "-f \"/temp\"", result.Args);
            }
            public void Should_Add_TargetDirectory_To_Arguments_If_Set()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.Settings.TargetDirectory = @"/temp";

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

                // Then
                Assert.Equal("export -u \"bob\" -p \"password\" " +
                             "-o \"repoOwner\" -r \"repo\" -f \"/temp\" " +
                             "-d \"/temp\"", result.Args);
            }
            public void Should_Use_GitReleaseManager_Executable_From_Tool_Path_If_Provided_On_Windows_When_Using_Token(string toolPath, string expected)
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.UseToken();
                fixture.Settings.ToolPath = toolPath;
                fixture.GivenSettingsToolPathExist();

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

                // Then
                Assert.Equal(expected, result.Path.FullPath);
            }
            public void Should_Add_LogFilePath_To_Arguments_If_Set()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.Settings.LogFilePath = @"/temp/log.txt";

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

                // Then
                Assert.Equal("export -u \"bob\" -p \"password\" " +
                             "-o \"repoOwner\" -r \"repo\" -f \"/temp\" " +
                             "-l \"/temp/log.txt\"", result.Args);
            }
Esempio n. 5
0
            public void Should_Add_LogFilePath_To_Arguments_If_Set()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.Settings.LogFilePath = @"c:/temp/log.txt";

                // When
                fixture.Export();

                // Then
                fixture.ProcessRunner.Received(1).Start(
                    Arg.Any <FilePath>(), Arg.Is <ProcessSettings>(p =>
                                                                   p.Arguments.Render() == "export -u \"bob\" -p \"password\" -o \"repoOwner\" -r \"repo\" -f \"c:/temp\" -l \"c:/temp/log.txt\""));
            }
            public void Should_All_NoLogo_To_Arguments_If_Set_When_Using_Token()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.UseToken();
                fixture.Settings.NoLogo = true;

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

                // Then
                Assert.Equal("export --token \"token\" " +
                             "-o \"repoOwner\" -r \"repo\" -f \"/temp\" " +
                             "--no-logo", result.Args);
            }
            public void Should_Add_TagName_To_Arguments_If_Set_When_Using_Token()
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.UseToken();
                fixture.Settings.TagName = "0.1.0";

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

                // Then
                Assert.Equal("export --token \"token\" " +
                             "-o \"repoOwner\" -r \"repo\" -f \"/temp\" " +
                             "-t \"0.1.0\"", result.Args);
            }
Esempio n. 8
0
            public void Should_Use_NuGet_Executable_From_Tool_Path_If_Provided(string toolPath, string expected)
            {
                // Given
                var fixture = new GitReleaseManagerExporterFixture();

                fixture.GivenCustomToolPathExist(expected);
                fixture.Settings.ToolPath = toolPath;

                // When
                fixture.Export();

                // Then
                fixture.ProcessRunner.Received(1).Start(
                    Arg.Is <FilePath>(p => p.FullPath == expected),
                    Arg.Any <ProcessSettings>());
            }