Table of Contents

Class Property

Namespace
Hegel
Assembly
Hegel.dll

Entry points: Test(Action<TestCase>, Settings?, Reporter?, string, int, string) runs a property and throws on failure, as a test method wants; Run(Action<TestCase>, Settings?, Reporter?, string, int, string) returns the RunReport instead.

[Fact]
public void Addition_commutes() => Property.Test(tc =>
{
    var a = tc.Draw(Generators.Integers());
    var b = tc.Draw(Generators.Integers());
    Assert.Equal(a + b, b + a);
});
public static class Property
Inheritance
Property
Inherited Members

Properties

EngineVersion

The version of the engine (libhegel) this frontend is running on.

public static string EngineVersion { get; }

Property Value

string

Methods

Run(Action<TestCase>, Settings?, Reporter?, string, int, string)

Run body as Test(Action<TestCase>, Settings?, Reporter?, string, int, string) does, but return the report instead of throwing when it fails. A run that cannot complete (a health check, a stale ReproduceFailure blob) still throws.

public static RunReport Run(Action<TestCase> body, Settings? settings = null, Reporter? reporter = null, string callerFile = "", int callerLine = 0, string callerMember = "")

Parameters

body Action<TestCase>
settings Settings
reporter Reporter
callerFile string
callerLine int
callerMember string

Returns

RunReport

Test(Action<TestCase>, Settings?, Reporter?, string, int, string)

Run body as a property-based test with settings (the defaults when null), reporting to reporter (standard error when null), and throw the failure it finds: the minimal failing test case's own exception, so the test framework shows it with its stack. The remaining parameters are filled in by the compiler and identify the test to the database.

public static RunReport Test(Action<TestCase> body, Settings? settings = null, Reporter? reporter = null, string callerFile = "", int callerLine = 0, string callerMember = "")

Parameters

body Action<TestCase>
settings Settings
reporter Reporter
callerFile string
callerLine int
callerMember string

Returns

RunReport