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

Commit ea9fb70

Browse files
committed
Added test to DiffService.
1 parent 1ed0c0b commit ea9fb70

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed
Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,42 @@
1-
using System;
2-
using System.IO;
3-
using System.Linq;
1+
using System.Threading.Tasks;
42
using GitHub.InlineReviews.Services;
5-
using GitHub.InlineReviews.UnitTests.Properties;
63
using GitHub.Services;
7-
using GitHub.Models;
84
using NSubstitute;
5+
using NSubstitute.ReturnsExtensions;
96
using NUnit.Framework;
107

118
namespace GitHub.InlineReviews.UnitTests.Services
129
{
1310
public class DiffServiceTests
1411
{
15-
public class TheParseFragmentMethod
12+
public class TheDiffMethod
1613
{
14+
[Test]
15+
public async Task DiffReturnsEmptyList()
16+
{
17+
var gitClient = Substitute.For<IGitClient>();
18+
gitClient.Compare(null, null, null, null).ReturnsNull();
19+
var target = new DiffService(gitClient);
20+
21+
var result = await target.Diff(null, null, null, null);
22+
23+
Assert.That(result, Is.Empty);
24+
}
25+
}
26+
27+
public class TheDiffOverloadMethod
28+
{
29+
[Test]
30+
public async Task DiffReturnsEmptyList()
31+
{
32+
var gitClient = Substitute.For<IGitClient>();
33+
gitClient.CompareWith(null, null, null, null, null).ReturnsNull();
34+
var target = new DiffService(gitClient);
35+
36+
var result = await target.Diff(null, null, null, null, null);
37+
38+
Assert.That(result, Is.Empty);
39+
}
1740
}
1841
}
1942
}

0 commit comments

Comments
 (0)