Table of Contents

Interface IRulesTestSetup

Namespace
NRules.Testing
Assembly
NRules.Testing.dll

Sets up rules test.

public interface IRulesTestSetup

Properties

CompilerSetupAction

Gets or sets the action to apply when creating the RuleCompiler.

Action<RuleCompiler> CompilerSetupAction { get; set; }

Property Value

Action<RuleCompiler>

Rules

Rules under test.

IReadOnlyCollection<RuleInfo> Rules { get; }

Property Value

IReadOnlyCollection<RuleInfo>

Methods

Rule(Rule)

Adds specific rule under test to the setup.

void Rule(Rule ruleInstance)

Parameters

ruleInstance Rule

Rule instance to add.

Rule(IRuleDefinition)

Adds specific rule under test to the setup.

void Rule(IRuleDefinition ruleDefinition)

Parameters

ruleDefinition IRuleDefinition

Rule definition to add.

Remarks

Rules registered as IRuleDefinition cannot participate in assertions that use Fluent DSL information, such as the rule CLR type.

Rule(Type)

Adds specific rule under test to the setup.

void Rule(Type ruleType)

Parameters

ruleType Type

Type of the rule to add.

Remarks

If ruleType is not derived from Rule or is not concrete, it will be ignored.

Rule<T>()

Adds specific rule under test to the setup.

void Rule<T>() where T : Rule

Type Parameters

T

Type of the rule to add.

Remarks

If T is not concrete, it will be ignored.