Exemple #1
0
            public void Should_Throw_If_Username_Is_Null()
            {
                // Given
                var fixture  = new GoCDFixture();
                var appVeyor = fixture.CreateGoCDService();

                // When
                var result = Record.Exception(() => appVeyor.GetHistory(null, "password"));

                // Then
                Assert.IsArgumentNullException(result, "username");
            }
Exemple #2
0
            public void Should_Return_False_If_Not_Running_On_GoCD()
            {
                // Given
                var fixture = new GoCDFixture();
                var gocd    = fixture.CreateGoCDService();

                // When
                var result = gocd.IsRunningOnGoCD;

                // Then
                Assert.False(result);
            }
Exemple #3
0
            public void Should_Return_Non_Null_Reference()
            {
                // Given
                var fixture = new GoCDFixture();
                var gocd    = fixture.CreateGoCDService();

                // When
                var result = gocd.Environment;

                // Then
                Assert.NotNull(result);
            }
Exemple #4
0
            public void Should_Throw_If_Not_Running_On_GoCD()
            {
                // Given
                var fixture  = new GoCDFixture();
                var appVeyor = fixture.CreateGoCDService();

                // When
                var result = Record.Exception(() => appVeyor.GetHistory("username", "password"));

                // Then
                Assert.IsExceptionWithMessage <CakeException>(result,
                                                              "The current build is not running on Go.CD.");
            }