Exemplo n.º 1
0
            public void Should_Find_GitLink_Runner()
            {
                // Given
                var fixture = new GitLinkFixture();

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

                // Then
                Assert.Equal("/Working/tools/gitlink.exe", result.Path.FullPath);
            }
Exemplo n.º 2
0
            public void Should_Set_RepositoryUrl()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.RepositoryUrl = "http://mydomain.com";

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

                // Then
                Assert.Equal("\"c:/temp\" -u \"http://mydomain.com\"", result.Args);
            }
Exemplo n.º 3
0
            public void Should_Use_Provided_Repository_Root_Path_In_Process_Arguments()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.RepositoryRootPath = "source";

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

                // Then
                Assert.Equal("\"/Working/source\"", result.Args);
            }
Exemplo n.º 4
0
            public void Should_Set_SkipVerify_Switch()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.SkipVerify = true;

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

                // Then
                Assert.Equal("\"c:/temp\" -skipverify", result.Args);
            }
Exemplo n.º 5
0
            public void Should_Set_IsDebug_Switch()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.IsDebug = true;

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

                // Then
                Assert.Equal("\"c:/temp\" -debug", result.Args);
            }
Exemplo n.º 6
0
            public void Should_Set_PdbDirectory()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.PdbDirectoryPath = DirectoryPath.FromString("pdb/");

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

                // Then
                Assert.Equal("\"c:/temp\" -d \"/Working/pdb\"", result.Args);
            }
Exemplo n.º 7
0
            public void Should_Set_PowerShell_Switch()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.UsePowerShell = true;

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

                // Then
                Assert.Equal("\"c:/temp\" -powershell", result.Args);
            }
Exemplo n.º 8
0
            public void Should_Throw_If_Repository_Root_Path_Is_Null()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.RepositoryRootPath = null;

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

                // Then
                Assert.IsArgumentNullException(result, "repositoryRootPath");
            }
Exemplo n.º 9
0
            public void Should_Set_ShaHash()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.ShaHash = "abcdef";

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

                // Then
                Assert.Equal("\"c:/temp\" -s \"abcdef\"", result.Args);
            }
Exemplo n.º 10
0
            public void Should_Set_LogFilePath()
            {
                // Given
                var fixture = new GitLinkFixture();

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

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

                // Then
                Assert.Equal("\"c:/temp\" -l \"/temp/log.txt\"", result.Args);
            }
Exemplo n.º 11
0
            public void Should_Set_Branch()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.Branch = "master";

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

                // Then
                Assert.Equal("\"c:/temp\" -b \"master\"", result.Args);
            }
Exemplo n.º 12
0
            public void Should_Set_Platform()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.Platform = "AnyCPU";

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

                // Then
                Assert.Equal("\"c:/temp\" -p \"AnyCPU\"", result.Args);
            }
Exemplo n.º 13
0
            public void Should_Set_Configuration()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.Configuration = "Release";

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

                // Then
                Assert.Equal("\"c:/temp\" -c \"Release\"", result.Args);
            }
Exemplo n.º 14
0
            public void Should_Set_SolutionFileName()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.Settings.SolutionFileName = "solution.sln";

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

                // Then
                Assert.Equal("\"c:/temp\" -f \"solution.sln\"", result.Args);
            }
Exemplo n.º 15
0
            public void Should_Throw_If_Has_A_Non_Zero_Exit_Code()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.GivenProcessExitsWithCode(1);

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("GitLink: Process returned an error (exit code 1).", result?.Message);
            }
Exemplo n.º 16
0
            public void Should_Throw_If_Process_Was_Not_Started()
            {
                // Given
                var fixture = new GitLinkFixture();

                fixture.GivenProcessCannotStart();

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

                // Then
                Assert.IsType <CakeException>(result);
                Assert.Equal("GitLink: Process was not started.", result?.Message);
            }