Table of Contents

Namespace Hegel.Xunit

Classes

HegelTestAttribute

Marks an xUnit test method as a Hegel property. The method takes one TestCase and returns void; the engine runs it many times with generated inputs, shrinks any failure to a minimal counterexample, puts the counterexample in the test's output and fails the test with the assertion itself, as Test(Action<TestCase>, Settings?, Reporter?, string, int, string) does:

[HegelTest]
public void Addition_commutes(TestCase tc)
{
    var a = tc.Draw(Generators.Integers());
    var b = tc.Draw(Generators.Integers());
    Assert.Equal(a + b, b + a);
}

The property is one test in xUnit's test tree. Profile and TestCases adjust its settings; for any other setting, or one only known at runtime, call Test(Action<TestCase>, Settings?, Reporter?, string, int, string) from a [Fact] instead.

HegelTestCase

The xUnit test case of a HegelTestAttribute method: one test, whose body the engine runs. Created by HegelTestDiscoverer; not used directly.

HegelTestDiscoverer

Finds the test case of a HegelTestAttribute method for xUnit, named by the attribute's Xunit.Sdk.XunitTestCaseDiscovererAttribute; not called directly.