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

Commit 452b144

Browse files
author
Meaghan Lewis
committed
Update assertions using Assert.Single
1 parent cd36d8f commit 452b144

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

test/GitHub.InlineReviews.UnitTests/Models/DiffUtilitiesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void HeaderOnly_OneChunkNoLines(string header)
2727
{
2828
var chunks = DiffUtilities.ParseFragment(header);
2929

30-
//Assert.Single(chunks);
30+
Assert.That(chunks, Has.One.Items);
3131
var chunk = chunks.First();
3232
Assert.That(chunk.Lines, Is.Empty);
3333
}

test/GitHub.InlineReviews.UnitTests/Tags/InlineCommentTaggerTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void ShouldReturnShowCommentTagForRhs()
4444
var firstPass = target.GetTags(span);
4545
var result = target.GetTags(span).ToList();
4646

47-
//Assert.Single(result);
47+
Assert.That(result, Has.One.Items);
4848
Assert.That(result[0].Tag, Is.InstanceOf(typeof(ShowInlineCommentTag)));
4949
}
5050

@@ -61,7 +61,7 @@ public void ShouldReturnAddNewCommentTagForAddedLineOnRhs()
6161
var firstPass = target.GetTags(span);
6262
var result = target.GetTags(span).ToList();
6363

64-
//Assert.Single(result);
64+
Assert.That(result, Has.One.Items);
6565
Assert.That(result[0].Tag, Is.InstanceOf(typeof(AddInlineCommentTag)));
6666
}
6767

@@ -94,7 +94,7 @@ public void ShouldReturnShowCommentTagForLhs()
9494
var firstPass = target.GetTags(span);
9595
var result = target.GetTags(span).ToList();
9696

97-
/**Assert.Single(result);**/
97+
Assert.That(result, Has.One.Items);
9898
Assert.That(result[0].Tag, Is.InstanceOf(typeof(ShowInlineCommentTag)));
9999
}
100100

@@ -111,7 +111,7 @@ public void ShouldReturnAddCommentTagForLhs()
111111
var firstPass = target.GetTags(span);
112112
var result = target.GetTags(span).ToList();
113113

114-
//Assert.Single(result);
114+
Assert.That(result, Has.One.Items);
115115
Assert.That(result[0].Tag, Is.InstanceOf(typeof(AddInlineCommentTag)));
116116
}
117117

@@ -221,7 +221,7 @@ public void ShouldReturnShowCommentTag()
221221
var firstPass = target.GetTags(span);
222222
var result = target.GetTags(span).ToList();
223223

224-
//Assert.Single(result);
224+
Assert.That(result, Has.One.Items);
225225
Assert.That(result[0].Tag, Is.InstanceOf(typeof(ShowInlineCommentTag)));
226226
}
227227

@@ -238,7 +238,7 @@ public void ShouldReturnAddNewCommentTagForAddedLine()
238238
var firstPass = target.GetTags(span);
239239
var result = target.GetTags(span).ToList();
240240

241-
//Assert.Single(result);
241+
Assert.That(result, Has.One.Items);
242242
Assert.That(result[0].Tag, Is.InstanceOf(typeof(AddInlineCommentTag)));
243243
}
244244

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void CreatesReplyPlaceholder()
2222
10,
2323
false);
2424

25-
//Assert.Single(target.Comments);
25+
Assert.That(target.Comments, Has.One.Items);
2626
Assert.AreEqual(string.Empty, target.Comments[0].Body);
2727
Assert.AreEqual(CommentEditState.Editing, target.Comments[0].EditState);
2828
}

0 commit comments

Comments
 (0)