Skip to content

Commit c9252b0

Browse files
Add additional tests
1 parent 4fb0b0a commit c9252b0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

IntelliTect.Multitool.Tests/RepositoryPaths.Tests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,19 @@ public void BuildVariables_BeingSetProperly()
2626
Assert.NotNull(solutionDir);
2727
Assert.NotEmpty(solutionDir);
2828
}
29+
30+
[Fact]
31+
public void TrySearchForGitContainingDirectory_ReturnsTrueWhenFound()
32+
{
33+
Assert.True(RepositoryPaths.TrySearchForGitContainingDirectory(new DirectoryInfo(Directory.GetCurrentDirectory()), out string gitParentDirectory));
34+
// Makes the assumption that the repository directory for this solution is named the same as the solution
35+
Assert.EndsWith(nameof(Multitool), gitParentDirectory);
36+
}
37+
38+
[Fact]
39+
public void TrySearchForGitContainingDirectory_ReturnsFalseWhenNotFound()
40+
{
41+
Assert.False(RepositoryPaths.TrySearchForGitContainingDirectory(new DirectoryInfo(Path.GetPathRoot(Directory.GetCurrentDirectory())), out string gitParentDirectory));
42+
Assert.Empty(gitParentDirectory);
43+
}
2944
}

0 commit comments

Comments
 (0)