Exemple #1
0
            public void Should_Set_PullRequestSystem()
            {
                // Given
                var log = new FakeLog();
                var pullRequestSystem = new FakePullRequestSystem(log);
                var modifiedFiles     = new List <FilePath>();

                // When
                var capability = new FakeFilteringByModifiedFilesCapability(log, pullRequestSystem, modifiedFiles);

                // Then
                capability.PullRequestSystem.ShouldBe(pullRequestSystem);
            }
Exemple #2
0
            public void Should_Throw_If_Not_Initialized()
            {
                // Given
                var log = new FakeLog();
                var pullRequestSystem = new FakePullRequestSystem(log);
                var modifiedFiles     = new List <FilePath>();
                var capability        = new FakeFilteringByModifiedFilesCapability(log, pullRequestSystem, modifiedFiles);

                // When
                var result =
                    Record.Exception(() =>
                                     capability.GetModifiedFilesInPullRequest());

                // Then
                result.IsInvalidOperationException("Initialize needs to be called first.");
            }
Exemple #3
0
            public void Should_Call_InternalGetModifiedFilesInPullRequest()
            {
                // Given
                var log = new FakeLog();
                var pullRequestSystem = new FakePullRequestSystem(log);
                var settings          = new ReportIssuesToPullRequestSettings(@"c:\repo");
                var modifiedFiles     = new List <FilePath> {
                    @"foo.cs"
                };
                var capability = new FakeFilteringByModifiedFilesCapability(log, pullRequestSystem, modifiedFiles);

                // When
                pullRequestSystem.Initialize(settings);
                var result = capability.GetModifiedFilesInPullRequest();

                // Then
                result.ShouldBe(modifiedFiles);
            }