Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LibGit2Sharp.Tests/BranchFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ public void LookingOutABranchByNameWithBadParamsThrows()
}
}

[Fact]
public void CanGetInformationFromUnbornBranch()
{
string repoPath = InitNewRepository(true);
Expand Down
25 changes: 25 additions & 0 deletions LibGit2Sharp.Tests/MetaFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,37 @@
using System.Linq;
using System.Reflection;
using System.Text;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;
using Xunit.Extensions;

namespace LibGit2Sharp.Tests
{
public class MetaFixture
{
[Fact]
public void PublicTestMethodsAreFactsOrTheories()
{
var exceptions = new[]
{
"LibGit2Sharp.Tests.FilterBranchFixture.Dispose",
};

var fixtures = from t in Assembly.GetAssembly(typeof(MetaFixture)).GetExportedTypes()
where t.IsPublic && !t.IsNested
where t.Namespace != typeof(BaseFixture).Namespace // Exclude helpers
let methods = t.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public)
from m in methods
where !m.GetCustomAttributes(typeof(FactAttribute), false)
.Concat(m.GetCustomAttributes(typeof(TheoryAttribute), false))
.Any()
let name = t.FullName + "." + m.Name
where !exceptions.Contains(name)
select name;

Assert.Equal("", string.Join(Environment.NewLine, fixtures.ToArray()));
}

// Related to https://github.com/libgit2/libgit2sharp/pull/251
[Fact]
public void TypesInLibGit2DecoratedWithDebuggerDisplayMustFollowTheStandardImplPattern()
Expand Down