blob: ae88f3d819168698ed10ba00d6dc9651830d43cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
using System.IO;
using NUnit.Framework;
namespace LibGit2Sharp.Tests
{
[TestFixture]
public class InitializingARepository : RepositoryToBeCreatedFixtureBase
{
[TestCase(true)]
[TestCase(false)]
public void ShouldReturnAValidGitPath(bool isBare)
{
var expectedGitDirName = new DirectoryInfo(PathToTempDirectory).Name;
expectedGitDirName += isBare ? "/" : "/.git/";
var gitDirPath = Repository.Init(PathToTempDirectory, isBare);
StringAssert.EndsWith(expectedGitDirName, gitDirPath);
}
[TestCase(true)]
[TestCase(false)]
public void ShouldGenerateAValidRepository(bool isBare)
{
var gitDirPath = Repository.Init(PathToTempDirectory, isBare);
using (var repo = new Repository(gitDirPath))
{
Assert.AreEqual(gitDirPath, repo.Details.RepositoryDirectory);
}
}
}
}
|