提交 2c38638d 编写于 作者: N nulltoken

Added some tests covering the instantiation of a repository and the parsing of provided paths.

上级 e87a8b89
using System;
using System.IO;
using NUnit.Framework;
namespace libgit2sharp.Tests
{
[TestFixture]
public class InstanciatingARepository
{
const string PathToRepository = "../../Resources/testrepo.git";
[Test]
[Ignore("https://github.com/libgit2/libgit2/issues/issue/28")]
public void ShouldThrowIfPassedANonValidGitDirectory()
{
var notAValidRepo = Path.GetTempPath();
var exception = Assert.Throws<Exception>(() => new Repository(notAValidRepo));
Assert.Fail("To be finalized.");
}
[Test]
[Ignore("https://github.com/libgit2/libgit2/issues/issue/28")]
public void ShouldThrowIfPassedANonExistingFolder()
{
var notAValidRepo = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString());
var exception = Assert.Throws<Exception>(() => new Repository(notAValidRepo));
Assert.Fail("To be finalized.");
}
[Test]
[Ignore]
public void ShouldAllowPassedRelativeBackslashedPath()
{
Assert.Fail("To be finalized.");
}
[Test]
[Ignore]
public void ShouldAllowPassedRelativeBackslahedPathWithaTrailingBackslash()
{
Assert.Fail("To be finalized.");
}
}
}
\ No newline at end of file
......@@ -47,6 +47,7 @@
<Compile Include="ObjectIdFixture.cs" />
<Compile Include="RepositoryFixtures.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WhenOpeningARepository.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\libgit2sharp\libgit2sharp.csproj">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册