diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-27 22:16:55 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-29 20:15:55 +0400 |
commit | 7bad609f7421759d4af35ec90630bce6361bfe13 (patch) | |
tree | 07f956dd36e33135d35d421d6ab93eb2a41c4dc3 /LibGit2Sharp.Tests/ResetIndexFixture.cs | |
parent | 9479bce63d78bbba3b692f6f6282ae71489b6e7f (diff) |
Make Reset() return a proper BareRepositoryException
Diffstat (limited to 'LibGit2Sharp.Tests/ResetIndexFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/ResetIndexFixture.cs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/LibGit2Sharp.Tests/ResetIndexFixture.cs b/LibGit2Sharp.Tests/ResetIndexFixture.cs index e6f5cf73..cb48f15a 100644 --- a/LibGit2Sharp.Tests/ResetIndexFixture.cs +++ b/LibGit2Sharp.Tests/ResetIndexFixture.cs @@ -2,20 +2,28 @@ using System.IO; using System.Linq; using LibGit2Sharp.Tests.TestHelpers; using Xunit; -using Xunit.Extensions; namespace LibGit2Sharp.Tests { public class ResetIndexFixture : BaseFixture { - [Theory] - [InlineData(true)] - [InlineData(false)] - public void ResetANewlyInitializedRepositoryThrows(bool isBare) + [Fact] + public void ResetANewlyInitializedBareRepositoryThrows() + { + SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); + + using (Repository repo = Repository.Init(scd.DirectoryPath, true)) + { + Assert.Throws<BareRepositoryException>(() => repo.Reset()); + } + } + + [Fact] + public void ResetANewlyInitializedNonBareRepositoryThrows() { SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); - using (Repository repo = Repository.Init(scd.DirectoryPath, isBare)) + using (Repository repo = Repository.Init(scd.DirectoryPath, false)) { Assert.Throws<LibGit2SharpException>(() => repo.Reset()); } @@ -26,7 +34,7 @@ namespace LibGit2Sharp.Tests { using (var repo = new Repository(BareTestRepoPath)) { - Assert.Throws<LibGit2SharpException>(() => repo.Reset()); + Assert.Throws<BareRepositoryException>(() => repo.Reset()); } } |