Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 2e21ae9

Browse files
Final code cleanup
1 parent 58e1797 commit 2e21ae9

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

test/GitHub.InlineReviews.UnitTests/ViewModels/InlineCommentThreadViewModelTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
3-
using System.Reactive.Linq;
44
using GitHub.InlineReviews.Services;
55
using GitHub.InlineReviews.ViewModels;
66
using GitHub.Models;
@@ -17,7 +17,7 @@ public void CreatesComments()
1717
{
1818
var target = new InlineCommentThreadViewModel(
1919
Substitute.For<ICommentService>(),
20-
CreateSession(), new InlineAnnotationViewModel[0],
20+
CreateSession(), Array.Empty<InlineAnnotationViewModel>(),
2121
CreateComments("Comment 1", "Comment 2"));
2222

2323
Assert.That(3, Is.EqualTo(target.Comments.Count));
@@ -45,7 +45,7 @@ public void PlaceholderCommitEnabledWhenCommentHasBody()
4545
{
4646
var target = new InlineCommentThreadViewModel(
4747
Substitute.For<ICommentService>(),
48-
CreateSession(), new InlineAnnotationViewModel[0], CreateComments("Comment 1"));
48+
CreateSession(), Array.Empty<InlineAnnotationViewModel>(), CreateComments("Comment 1"));
4949

5050
Assert.That(target.Comments[1].CommitEdit.CanExecute(null), Is.False);
5151

@@ -59,7 +59,7 @@ public void PostsCommentInReplyToCorrectComment()
5959
var session = CreateSession();
6060
var target = new InlineCommentThreadViewModel(
6161
Substitute.For<ICommentService>(),
62-
session, new InlineAnnotationViewModel[0],
62+
session, Array.Empty<InlineAnnotationViewModel>(),
6363
CreateComments("Comment 1", "Comment 2"));
6464

6565
target.Comments[2].Body = "New Comment";

test/GitHub.InlineReviews.UnitTests/ViewModels/NewInlineCommentThreadViewModelTests.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.ComponentModel;
34
using GitHub.InlineReviews.Services;
45
using GitHub.InlineReviews.ViewModels;
@@ -21,7 +22,7 @@ public void CreatesReplyPlaceholder()
2122
{
2223
var target = new NewInlineCommentThreadViewModel(
2324
Substitute.For<ICommentService>(),
24-
CreateSession(), new InlineAnnotationViewModel[0],
25+
CreateSession(), Array.Empty<InlineAnnotationViewModel>(),
2526
Substitute.For<IPullRequestSessionFile>(),
2627
10,
2728
false);
@@ -37,7 +38,7 @@ public void NeedsPushTracksFileCommitSha()
3738
var file = CreateFile();
3839
var target = new NewInlineCommentThreadViewModel(
3940
Substitute.For<ICommentService>(),
40-
CreateSession(), new InlineAnnotationViewModel[0],
41+
CreateSession(), Array.Empty<InlineAnnotationViewModel>(),
4142
file,
4243
10,
4344
false);
@@ -62,7 +63,7 @@ public void PlaceholderCommitEnabledWhenCommentHasBodyAndPostCommentIsEnabled()
6263
var file = CreateFile();
6364
var target = new NewInlineCommentThreadViewModel(
6465
Substitute.For<ICommentService>(),
65-
CreateSession(), new InlineAnnotationViewModel[0],
66+
CreateSession(), Array.Empty<InlineAnnotationViewModel>(),
6667
file,
6768
10,
6869
false);
@@ -86,7 +87,7 @@ public void PostsCommentToCorrectAddedLine()
8687
var file = CreateFile();
8788
var target = new NewInlineCommentThreadViewModel(
8889
Substitute.For<ICommentService>(),
89-
session, new InlineAnnotationViewModel[0],
90+
session, Array.Empty<InlineAnnotationViewModel>(),
9091
file, 10, false);
9192

9293
target.Comments[0].Body = "New Comment";
@@ -119,7 +120,7 @@ public void AddsCommentToCorrectDeletedLine()
119120

120121
var target = new NewInlineCommentThreadViewModel(
121122
Substitute.For<ICommentService>(),
122-
session, new InlineAnnotationViewModel[0],
123+
session, Array.Empty<InlineAnnotationViewModel>(),
123124
file, 16, true);
124125

125126
target.Comments[0].Body = "New Comment";

0 commit comments

Comments
 (0)