Table of Contents

Class PropertyAttribute

Namespace
Conjecture.Xunit.V3
Assembly
Conjecture.Xunit.V3.dll

Marks a method as a Conjecture property-based test (xUnit v3).

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer(typeof(PropertyTestCaseDiscoverer))]
public sealed class PropertyAttribute : FactAttribute, IFactAttribute
Inheritance
FactAttribute
PropertyAttribute
Implements
IFactAttribute
Inherited Members
FactAttribute.DisplayName
FactAttribute.Explicit
FactAttribute.Skip
FactAttribute.SkipExceptions
FactAttribute.SkipType
FactAttribute.SkipUnless
FactAttribute.SkipWhen
FactAttribute.SourceFilePath
FactAttribute.SourceLineNumber
FactAttribute.Timeout

Constructors

PropertyAttribute(string?, int)

Marks a method as a Conjecture property-based test (xUnit v3).

public PropertyAttribute(string? sourceFilePath = null, int sourceLineNumber = -1)

Parameters

sourceFilePath string
sourceLineNumber int

Properties

DeadlineMs

Deadline for each test run in milliseconds. 0 means no deadline.

public int DeadlineMs { get; set; }

Property Value

int

MaxExamples

Maximum number of examples to generate. Defaults to 100.

public int MaxExamples { get; set; }

Property Value

int

MaxStrategyRejections

Maximum number of times a strategy may reject a value. Defaults to 5.

public int MaxStrategyRejections { get; set; }

Property Value

int

Seed

Optional fixed seed for deterministic runs. 0 means use a random seed.

public ulong Seed { get; set; }

Property Value

ulong

Targeting

Whether to run a targeting phase after generation. Defaults to true.

public bool Targeting { get; set; }

Property Value

bool

TargetingProportion

Fraction of MaxExamples budget allocated to the targeting phase. Defaults to 0.5.

public double TargetingProportion { get; set; }

Property Value

double

UseDatabase

Whether to use the example database. Defaults to true.

public bool UseDatabase { get; set; }

Property Value

bool