Exemplo n.º 1
0
            public void Should_Return_PlainText()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());

                // When
                var result = prSystem.GetPreferredCommentFormat();

                // Then
                result.ShouldBe(PrcaCommentFormat.PlainText);
            }
Exemplo n.º 2
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());

                // When
                var result = Record.Exception(() => prSystem.Initialize(null));

                // Then
                result.IsArgumentNullException("settings");
            }
Exemplo n.º 3
0
            public void Should_Set_Log()
            {
                // Given
                var log = new FakeLog();

                // When
                var prSystem = new FakePullRequestSystem(log);

                // Then
                prSystem.Log.ShouldBe(log);
            }
Exemplo n.º 4
0
            public void Should_Throw_If_PrcaSettings_Is_Null()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());

                // When
                var result = Record.Exception(() => prSystem.PostDiscussionThreads(new List <ICodeAnalysisIssue>(), "Foo"));

                // Then
                result.IsInvalidOperationException("Initialize needs to be called first.");
            }
Exemplo n.º 5
0
            public void Should_Throw_If_PrcaSettings_Is_Null()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());

                // When
                var result = Record.Exception(() => prSystem.MarkThreadsAsFixed(new List <IPrcaDiscussionThread>()));

                // Then
                result.IsInvalidOperationException("Initialize needs to be called first.");
            }
Exemplo n.º 6
0
            public void Should_Throw_If_PrcaSettings_Is_Null()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());

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

                // Then
                result.IsInvalidOperationException("Initialize needs to be called first.");
            }
Exemplo n.º 7
0
            public void Should_Return_True()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());
                var settings = new ReportIssuesToPullRequestSettings(@"c:\foo");

                // When
                var result = prSystem.Initialize(settings);

                // Then
                result.ShouldBe(true);
            }
Exemplo n.º 8
0
            public void Should_Set_Settings()
            {
                // Given
                var prSystem = new FakePullRequestSystem(new FakeLog());
                var settings = new ReportIssuesToPullRequestSettings(@"c:\foo");

                // When
                prSystem.Initialize(settings);

                // Then
                prSystem.PrcaSettings.ShouldBe(settings);
            }