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

Commit 37ab7f6

Browse files
committed
Fixed failing LocalRepositoryModel tests
1 parent 083533d commit 37ab7f6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

test/UnitTests/GitHub.App/Models/RepositoryModelTests.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ public void NoRemoteUrl()
5757
{
5858
using (var temp = new TempDirectory())
5959
{
60-
var provider = Substitutes.ServiceProvider;
61-
var gitservice = provider.GetGitService();
60+
var gitService = Substitute.For<IGitService>();
6261
var repo = Substitute.For<IRepository>();
6362
var path = temp.Directory.CreateSubdirectory("repo-name");
64-
gitservice.GetUri(path.FullName).Returns((UriString)null);
65-
var model = new LocalRepositoryModel(path.FullName);
63+
gitService.GetUri(path.FullName).Returns((UriString)null);
64+
var model = new LocalRepositoryModel(path.FullName, gitService);
6665
Assert.That("repo-name", Is.EqualTo(model.Name));
6766
}
6867
}
@@ -72,12 +71,11 @@ public void WithRemoteUrl()
7271
{
7372
using (var temp = new TempDirectory())
7473
{
75-
var provider = Substitutes.ServiceProvider;
76-
var gitservice = provider.GetGitService();
74+
var gitService = Substitute.For<IGitService>();
7775
var repo = Substitute.For<IRepository>();
7876
var path = temp.Directory.CreateSubdirectory("repo-name");
79-
gitservice.GetUri(path.FullName).Returns(new UriString("https://github.com/user/repo-name"));
80-
var model = new LocalRepositoryModel(path.FullName);
77+
gitService.GetUri(path.FullName).Returns(new UriString("https://github.com/user/repo-name"));
78+
var model = new LocalRepositoryModel(path.FullName, gitService);
8179
Assert.That("repo-name", Is.EqualTo(model.Name));
8280
Assert.That("user", Is.EqualTo(model.Owner));
8381
}

0 commit comments

Comments
 (0)