Пример #1
0
            public void Should_Set_Approved_Vote_On_Tfs_Pull_Request()
            {
                // Given
                var fixture     = new PullRequestFixture(BasePullRequestFixture.ValidTfsUrl, 23);
                var pullRequest = new TfsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);

                // When
                pullRequest.Vote(TfsPullRequestVote.Approved);

                // Then
                // ?? Nothing to validate here since the method returns void
            }
Пример #2
0
            public void Should_Throw_If_Vote_Value_Is_Invalid_On_Tfs_Pull_Request()
            {
                // Given
                var fixture     = new PullRequestFixture(BasePullRequestFixture.ValidTfsUrl, 23);
                var pullRequest = new TfsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);

                // When
                var result = Record.Exception(() => pullRequest.Vote((TfsPullRequestVote)3));

                // Then
                result.ShouldNotBe(null);
                result.IsExpected("Vote");
                result.Message.ShouldBe("Something went wrong");
            }
Пример #3
0
            public void Should_Throw_If_Null_Is_Returned_On_Tfs_Pull_Request()
            {
                // Given
                var fixture = new PullRequestFixture(BasePullRequestFixture.ValidTfsUrl, 23)
                {
                    GitClientFactory = new FakeNullForMethodsGitClientFactory(),
                };
                var pullRequest = new TfsPullRequest(fixture.Log, fixture.Settings, fixture.GitClientFactory);

                // When
                var result = Record.Exception(() => pullRequest.Vote(TfsPullRequestVote.WaitingForAuthor));

                // Then
                result.ShouldNotBe(null);
                result.IsExpected("Vote");
                result.IsTfsPullRequestNotFoundException();
            }