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

Commit 5fe8d0d

Browse files
committed
Fix NavigationService tests
1 parent 28285d5 commit 5fe8d0d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/UnitTests/GitHub.App/Services/NavigationServiceTests.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ public void FindNearestMatchingLine(IList<string> fromLines, IList<string> toLin
2929

3030
public class TheFindMatchingLineMethod
3131
{
32-
[TestCase(new[] { "void method()", "code" }, new[] { "void method()", "// code" }, 1, 1)]
32+
[TestCase(new[] { "void method()", "code" }, new[] { "void method()", "// code" }, 1, 1, Description = "Find using line below")]
33+
[TestCase(new[] { "void method()", "code" }, new[] { "void method()", "// code", "// code" }, 2, -1, Description = "Out of range")]
34+
[TestCase(new[] { "code" }, new[] { "// code" }, 0, -1, Description = "No matching line")]
3335
[TestCase(new[] { "void method()", "code" }, new[] { "void method()" }, 1, 0, Description = "Keep within bounds")]
34-
[TestCase(new[] { "code" }, new[] { "// code" }, 0, -1)]
3536
[TestCase(new[] { "line", "line" }, new[] { "line", "line" }, 0, 0, Description = "Match nearest line")]
3637
[TestCase(new[] { "line", "line" }, new[] { "line", "line" }, 1, 1, Description = "Match nearest line")]
3738
public void FindNearestMatchingLine(IList<string> fromLines, IList<string> toLines, int line,
@@ -45,9 +46,5 @@ public void FindNearestMatchingLine(IList<string> fromLines, IList<string> toLin
4546
}
4647
}
4748

48-
static NavigationService CreateNavigationService()
49-
{
50-
var sp = Substitute.For<IGitHubServiceProvider>();
51-
return new NavigationService(sp);
52-
}
49+
static NavigationService CreateNavigationService() => new NavigationService();
5350
}

0 commit comments

Comments
 (0)