public async Task CommitShaIsReadFromPullRequestModelIfBranchNotCheckedOut()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest();
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);
                    service.IsUnmodifiedAndPushed(Arg.Any <ILocalRepositoryModel>(), FilePath, Arg.Any <byte[]>()).Returns(false);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        isCheckedOut: false);

                    var editor = new FakeEditorContentSource(headContents);
                    var file   = await target.GetFile(FilePath, editor);

                    Assert.Equal("HEAD_SHA", file.CommitSha);
                }
            }
            public async Task CommitShaIsSetIfUnmodified()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest();
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);
                    service.IsUnmodifiedAndPushed(Arg.Any <ILocalRepositoryModel>(), FilePath, Arg.Any <byte[]>()).Returns(true);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        true);

                    var editor = new FakeEditorContentSource(headContents);
                    var file   = await target.GetFile(FilePath, editor);

                    Assert.Equal("BRANCH_TIP", file.CommitSha);
                }
            }
예제 #3
0
            public async Task DoesntThrowIfGetFileCalledDuringUpdate()
            {
                var thread = CreateThread(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(thread);
                    var service     = CreateRealSessionService(diffService);

                    var target = new PullRequestSession(
                        service,
                        CreateActor(),
                        pullRequest,
                        CreateLocalRepository(),
                        string.Empty,
                        true);

                    await target.GetFile("test.cs");

                    // Simulate calling GetFile with a file that's not yet been initialized
                    // while doing the Update.
                    service.WhenForAnyArgs(x => x.Diff(null, null, null, null))
                    .Do(_ => target.GetFile("other.cs").Forget());
                    UpdateReadPullRequest(service, pullRequest);

                    await target.Refresh();
                }
            }
            public async Task DoesntThrowIfGetFileCalledDuringUpdate()
            {
                var comment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment);
                    var service     = CreateService(diffService);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        string.Empty,
                        true);

                    await target.GetFile("test.cs");

                    // Simulate calling GetFile with a file that's not yet been initialized
                    // while doing the Update.
                    service.WhenForAnyArgs(x => x.Diff(null, null, null, null, null))
                    .Do(_ => target.GetFile("other.cs").Forget());

                    await target.Update(pullRequest);
                }
            }
            async Task <PullRequestSession> CreateTarget(FakeDiffService diffService)
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var pullRequest = CreatePullRequest();
                var service     = CreateService(diffService);

                diffService.AddFile(FilePath, baseContents);

                var target = new PullRequestSession(
                    service,
                    Substitute.For <IAccount>(),
                    pullRequest,
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);

                var editor = new FakeEditorContentSource(headContents);
                var file   = await target.GetFile(FilePath, editor);

                return(target);
            }
            public async Task AddsNewReviewCommentToThread()
            {
                var baseContents   = @"Line 1
Line 2
Line 3
Line 4";
                var editorContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var comment1 = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment1");

                var comment2 = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment2");


                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment1);
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var editor = new FakeEditorContentSource(editorContents);
                    var file   = await target.GetFile(FilePath, editor);

                    var thread = file.InlineCommentThreads.Single();

                    Assert.Equal("Comment1", thread.Comments.Single().Body);
                    Assert.Equal(2, thread.LineNumber);

                    pullRequest = CreatePullRequest(comment1, comment2);
                    await target.Update(pullRequest);

                    thread = file.InlineCommentThreads.Single();

                    Assert.Equal(2, thread.Comments.Count);
                    Assert.Equal(new[] { "Comment1", "Comment2" }, thread.Comments.Select(x => x.Body).ToArray());
                    Assert.Equal(2, thread.LineNumber);
                }
            }
            public async Task UpdatesReviewCommentWithNewBody()
            {
                var baseContents   = @"Line 1
Line 2
Line 3
Line 4";
                var editorContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var originalComment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Original Comment");

                var updatedComment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Updated Comment");


                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(originalComment);
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var editor = new FakeEditorContentSource(editorContents);
                    var file   = await target.GetFile(FilePath, editor);

                    var thread = file.InlineCommentThreads.Single();

                    Assert.Equal("Original Comment", thread.Comments.Single().Body);
                    Assert.Equal(2, thread.LineNumber);

                    pullRequest = CreatePullRequest(updatedComment);
                    await target.Update(pullRequest);

                    thread = file.InlineCommentThreads.Single();

                    Assert.Equal("Updated Comment", thread.Comments.Single().Body);
                    Assert.Equal(2, thread.LineNumber);
                }
            }
예제 #8
0
            public void IsFalseWithNoPendingReview()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.False);
            }
예제 #9
0
            public void ThrowsWithNoPendingReview()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.ThrowsAsync <InvalidOperationException>(async() => await target.CancelReview());
            }
            public async Task CommitShaIsSet()
            {
                var target = new PullRequestSession(
                    CreateSessionService(),
                    Substitute.For <IAccount>(),
                    CreatePullRequest(),
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);
                var file = await target.GetFile(FilePath);

                Assert.That("HEAD_SHA", Is.SameAs(file.CommitSha));
            }
            public async Task BaseShaIsSet()
            {
                var target = new PullRequestSession(
                    CreateSessionService(),
                    Substitute.For <IAccount>(),
                    CreatePullRequest(),
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);
                var file = await target.GetFile(FilePath);

                Assert.Same("BASE_SHA", file.BaseSha);
            }
예제 #12
0
            public async Task BaseShaIsSet()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);
                var file = await target.GetFile(FilePath);

                Assert.That("BASE_SHA", Is.SameAs(file.BaseSha));
            }
예제 #13
0
            public async Task AddsNewReviewCommentToThreadNonHeadFile()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var comment1 = CreateThread(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment1");
                var comment2 = CreateThread(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment2");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment1);
                    var service     = CreateRealSessionService(diffService);

                    diffService.AddFile(FilePath, baseContents, "MERGE_BASE");
                    diffService.AddFile(FilePath, headContents, "123");

                    var target = new PullRequestSession(
                        service,
                        CreateActor(),
                        pullRequest,
                        CreateLocalRepository(),
                        "owner",
                        true);

                    var file = await target.GetFile(FilePath, "123");

                    Assert.That(file.InlineCommentThreads[0].Comments, Has.Count.EqualTo(1));
                    Assert.That(file.InlineCommentThreads[0].LineNumber, Is.EqualTo(2));

                    pullRequest = CreatePullRequest(comment1, comment2);
                    UpdateReadPullRequest(service, pullRequest);
                    await target.Refresh();

                    Assert.That(file.InlineCommentThreads[0].Comments, Has.Count.EqualTo(2));
                    Assert.That(file.InlineCommentThreads[0].LineNumber, Is.EqualTo(2));
                }
            }
            public async Task UpdatesReviewCommentWithEditorContents()
            {
                var baseContents   = @"Line 1
Line 2
Line 3
Line 4";
                var diskContents   = @"Line 1
Line 2
Line 3 with comment
Line 4";
                var editorContents = @"New Line 1
New Line 2
Line 1
Line 2
Line 3 with comment
Line 4";

                var comment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment);
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var editor = new FakeEditorContentSource(diskContents);
                    var file   = await target.GetFile(FilePath, editor);

                    var thread = file.InlineCommentThreads.First();

                    Assert.Equal(2, thread.LineNumber);
                    editor.SetContent(editorContents);

                    await target.UpdateEditorContent(FilePath);

                    Assert.Equal(4, thread.LineNumber);
                }
            }
예제 #15
0
            public async Task PinnedCommitShaIsSet()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);
                var file = await target.GetFile(FilePath, "123");

                Assert.That("123", Is.SameAs(file.CommitSha));
                Assert.That(file.IsTrackingHead, Is.False);
            }
예제 #16
0
            public async Task AddsNewReviewCommentToThreadOnHeadFile()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";
                var comment1     = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment1");
                var comment2     = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment", "Comment2");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment1);
                    var service     = CreateRealSessionService(diffService);

                    diffService.AddFile(FilePath, baseContents, "MERGE_BASE");
                    diffService.AddFile(FilePath, headContents, "HEAD_SHA");

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var file = await target.GetFile(FilePath, "HEAD");

                    Assert.That(file.InlineCommentThreads[0].Comments, Has.Count.EqualTo(1));
                    Assert.That(file.InlineCommentThreads[0].LineNumber, Is.EqualTo(2));

                    pullRequest = CreatePullRequest(comment1, comment2);
                    await target.Update(pullRequest);

                    Assert.That(file.InlineCommentThreads[0].Comments, Has.Count.EqualTo(2));
                    Assert.That(file.InlineCommentThreads[0].LineNumber, Is.EqualTo(2));
                }
            }
예제 #17
0
            public async Task SameNonHeadCommitShasReturnSameFiles()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    Substitute.For <IAccount>(),
                    CreatePullRequest(),
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);
                var file1 = await target.GetFile(FilePath, "123");

                var file2 = await target.GetFile(FilePath, "123");

                Assert.That(file1, Is.SameAs(file2));
            }
예제 #18
0
            public async Task DifferentCommitShasReturnDifferentFiles()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);
                var file1 = await target.GetFile(FilePath, "123");

                var file2 = await target.GetFile(FilePath, "456");

                Assert.That(file1, Is.Not.SameAs(file2));
            }
예제 #19
0
            public void IsTrueWithPendingReviewForCurrentUser()
            {
                var currentUser = CreateActor();
                var review      = CreateReview(author: currentUser, state: PullRequestReviewState.Pending);
                var pr          = CreatePullRequest(review);

                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    currentUser,
                    pr,
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.True);
            }
            public async Task UpdatesReviewCommentWithContentsFromGitWhenBranchNotCheckedOut()
            {
                var baseContents   = @"Line 1
Line 2
Line 3
Line 4";
                var gitContents    = Encoding.UTF8.GetBytes(@"Line 1
Line 2
Line 3 with comment
Line 4");
                var editorContents = @"Editor content";

                var comment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment);
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);

                    // Because the PR branch isn't checked out, the file contents should be read
                    // from git and not the editor or disk.
                    service.ExtractFileFromGit(Arg.Any <ILocalRepositoryModel>(), PullRequestNumber, "HEAD_SHA", FilePath)
                    .Returns(Task.FromResult(gitContents));

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        isCheckedOut: false);

                    var editor = new FakeEditorContentSource(editorContents);
                    var file   = await target.GetFile(FilePath, editor);

                    var thread = file.InlineCommentThreads.First();

                    Assert.Equal(2, thread.LineNumber);
                }
            }
예제 #21
0
            public async Task UpdatesThePullRequestModel()
            {
                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    Substitute.For <IAccount>(),
                    CreatePullRequest(),
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);

                var newPullRequest = CreatePullRequest();
                await target.Update(newPullRequest);

                // PullRequestModel overrides Equals such that two PRs with the same number are
                // considered equal. This was causing the PullRequest not to be updated on refresh.
                // Test that this works correctly!
                Assert.That(newPullRequest, Is.SameAs(target.PullRequest));
            }
예제 #22
0
            public void IsTrueWithPendingReviewForCurrentUser()
            {
                var currentUser = Substitute.For <IAccount>();
                var pr          = CreatePullRequest();
                var review      = CreatePullRequestReview(currentUser, PullRequestReviewState.Pending);

                pr.Reviews.Returns(new[] { review });

                var target = new PullRequestSession(
                    CreateRealSessionService(),
                    currentUser,
                    pr,
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.True);
            }
예제 #23
0
            public async Task UpdatesThePullRequestModel()
            {
                var sessionService = CreateMockSessionService();
                var target         = new PullRequestSession(
                    sessionService,
                    CreateActor(),
                    CreatePullRequest(),
                    CreateLocalRepository(),
                    "owner",
                    true);

                var newPullRequest = CreatePullRequest();

                UpdateReadPullRequest(sessionService, newPullRequest);
                await target.Refresh();

                Assert.That(newPullRequest, Is.SameAs(target.PullRequest));
            }
            public async Task CommitShaIsNullWhenChangedToModified()
            {
                var baseContents   = @"Line 1
Line 2
Line 3
Line 4";
                var headContents   = Encoding.UTF8.GetBytes(@"Line 1
Line 2
Line 3 with comment
Line 4");
                var editorContents = Encoding.UTF8.GetBytes(@"Line 1
Line 2
Line 3 with comment
Line 4 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest();
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);
                    service.IsUnmodifiedAndPushed(Arg.Any <ILocalRepositoryModel>(), FilePath, headContents).Returns(true);
                    service.IsUnmodifiedAndPushed(Arg.Any <ILocalRepositoryModel>(), FilePath, editorContents).Returns(false);

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var editor = new FakeEditorContentSource(headContents);
                    var file   = await target.GetFile(FilePath, editor);

                    Assert.Equal("BRANCH_TIP", file.CommitSha);

                    editor.SetContent(editorContents);
                    await target.UpdateEditorContent(FilePath);

                    Assert.Null(file.CommitSha);
                }
            }
            public async Task IsFalseWhenReviewCancelled()
            {
                var currentUser = CreateActor();
                var review      = CreateReview(author: currentUser, state: PullRequestReviewState.Pending);
                var pr          = CreatePullRequest(review);

                var target = new PullRequestSession(
                    Substitute.For <IPullRequestSessionService>(),
                    currentUser,
                    pr,
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.True);

                await target.CancelReview();

                Assert.That(target.HasPendingReview, Is.False);
            }
예제 #26
0
            public async Task IsTrueWhenRefreshedWithPendingReview()
            {
                var sessionService = CreateMockSessionService();
                var currentUser    = CreateActor("grokys");
                var target         = new PullRequestSession(
                    sessionService,
                    currentUser,
                    CreatePullRequest(),
                    CreateLocalRepository(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.False);

                var review = CreateReview(author: currentUser, state: PullRequestReviewState.Pending);

                UpdateReadPullRequest(sessionService, CreatePullRequest(review));
                await target.Refresh();

                Assert.That(target.HasPendingReview, Is.True);
            }
예제 #27
0
            public async Task IsTrueWithUpdatedWithPendingReview()
            {
                var currentUser = Substitute.For <IAccount>();
                var target      = new PullRequestSession(
                    CreateRealSessionService(),
                    currentUser,
                    CreatePullRequest(),
                    Substitute.For <ILocalRepositoryModel>(),
                    "owner",
                    true);

                Assert.That(target.HasPendingReview, Is.False);

                var pr     = CreatePullRequest();
                var review = CreatePullRequestReview(currentUser, PullRequestReviewState.Pending);

                pr.Reviews.Returns(new[] { review });
                await target.Update(pr);

                Assert.That(target.HasPendingReview, Is.True);
            }
            public async Task MatchesReviewCommentOnOriginalLineGettingContentFromDisk()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var comment = CreateComment(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(comment);
                    var service     = CreateService(diffService);

                    diffService.AddFile(FilePath, baseContents);
                    service.ReadFileAsync(FilePath).Returns(Encoding.UTF8.GetBytes(headContents));

                    var target = new PullRequestSession(
                        service,
                        Substitute.For <IAccount>(),
                        pullRequest,
                        Substitute.For <ILocalRepositoryModel>(),
                        "owner",
                        true);

                    var file = await target.GetFile(FilePath);

                    var thread = file.InlineCommentThreads.First();

                    Assert.Equal(2, thread.LineNumber);
                }
            }
예제 #29
0
            public async Task DiffShaIsSet()
            {
                var diff           = new List <DiffChunk>();
                var sessionService = CreateRealSessionService();

                sessionService.Diff(
                    Arg.Any <LocalRepositoryModel>(),
                    "MERGE_BASE",
                    "HEAD_SHA",
                    FilePath).Returns(diff);

                var target = new PullRequestSession(
                    sessionService,
                    CreateActor(),
                    CreatePullRequest(),
                    Substitute.For <LocalRepositoryModel>(),
                    "owner",
                    true);
                var file = await target.GetFile(FilePath);

                Assert.That(diff, Is.SameAs(file.Diff));
            }
예제 #30
0
            public async Task InlineCommentThreadsIsSet()
            {
                var baseContents = @"Line 1
Line 2
Line 3
Line 4";
                var headContents = @"Line 1
Line 2
Line 3 with comment
Line 4";

                var thread = CreateThread(@"@@ -1,4 +1,4 @@
 Line 1
 Line 2
-Line 3
+Line 3 with comment");

                using (var diffService = new FakeDiffService())
                {
                    var pullRequest = CreatePullRequest(thread);
                    var service     = CreateRealSessionService(diffService);

                    diffService.AddFile(FilePath, baseContents, "MERGE_BASE");
                    diffService.AddFile(FilePath, headContents, "HEAD_SHA");

                    var target = new PullRequestSession(
                        service,
                        CreateActor(),
                        pullRequest,
                        Substitute.For <LocalRepositoryModel>(),
                        "owner",
                        true);

                    var file = await target.GetFile(FilePath);

                    var inlineThread = file.InlineCommentThreads.First();
                    Assert.That(2, Is.EqualTo(inlineThread.LineNumber));
                }
            }