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

Commit 023f693

Browse files
committed
Add test for when there's no repository
Should return same as repository with no remotes.
1 parent 1fe4009 commit 023f693

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/GitHub.Exports.UnitTests/GitServiceIntegrationTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@
77

88
public class GitServiceIntegrationTests
99
{
10+
public class TheCreateLocalRepositoryModelMethod : TestBaseClass
11+
{
12+
[TestCase(true)]
13+
[TestCase(false)]
14+
public void NoRepository_Same_As_Repository_With_No_CloneUrl(bool createRepository)
15+
{
16+
using (var temp = new TempDirectory())
17+
{
18+
var path = temp.Directory.FullName;
19+
if (createRepository)
20+
{
21+
using (var repo = new Repository(Repository.Init(path))) { }
22+
}
23+
24+
var target = new GitService(new RepositoryFacade());
25+
26+
var model = target.CreateLocalRepositoryModel(path);
27+
28+
Assert.That(model, Is.Not.Null);
29+
Assert.That(model.LocalPath, Is.EqualTo(path));
30+
Assert.That(model.Name, Is.EqualTo(temp.Directory.Name));
31+
}
32+
}
33+
}
34+
1035
public class TheGetLatestPushedShaMethod : TestBaseClass
1136
{
1237
[Test]

0 commit comments

Comments
 (0)