Example #1
0
            public void Should_Return_True_For_Existing_Comment_Source()
            {
                // Given
                var commentSource = "foo";
                var thread        =
                    new GitPullRequestCommentThread
                {
                    Id            = 123,
                    Status        = CommentThreadStatus.Active,
                    ThreadContext = new CommentThreadContext()
                    {
                        FilePath = "/foo.cs"
                    },
                    Comments   = new List <Comment>(),
                    Properties = new PropertiesCollection()
                };

                thread.SetCommentSource(commentSource);

                // When
                var result = thread.IsCommentSource(commentSource);

                // Then
                result.ShouldBeTrue();
            }
Example #2
0
            public void Should_Throw_If_Thread_Is_Null()
            {
                // Given
                GitPullRequestCommentThread thread = null;
                var value = "foo";

                // When
                var result = Record.Exception(() => thread.IsCommentSource(value));

                // Then
                result.IsArgumentNullException("thread");
            }
Example #3
0
            public void Should_Throw_If_Properties_Are_Null()
            {
                // Given
                var thread =
                    new GitPullRequestCommentThread
                {
                    Id            = 123,
                    Status        = CommentThreadStatus.Active,
                    ThreadContext = new CommentThreadContext {
                        FilePath = "/foo.cs"
                    },
                    Comments   = new List <Comment>(),
                    Properties = null
                };
                var value = "foo";

                // When
                var result = Record.Exception(() => thread.IsCommentSource(value));

                // Then
                result.IsInvalidOperationException("Properties collection is not created.");
            }