Class GovernanceConstraintContract<TContext>
Reusable contract fixture for IGovernanceConstraint<TContext> implementations.
public abstract class GovernanceConstraintContract<TContext>
Type Parameters
TContextThe framework-neutral evaluation context type.
- Inheritance
-
GovernanceConstraintContract<TContext>
- Inherited Members
Methods
CreateConstraint()
Creates the constraint implementation under test.
protected abstract IGovernanceConstraint<TContext> CreateConstraint()
Returns
- IGovernanceConstraint<TContext>
The constraint implementation to validate.
CreateEvaluationContext()
Creates the context supplied to the constraint implementation under test.
protected abstract TContext CreateEvaluationContext()
Returns
- TContext
The evaluation context to validate with.
VerifyConstraintReturnsSafeResultAsync(CancellationToken)
Verifies that the constraint returns a safe, non-null result shape.
public ValueTask<ConstraintEvaluationResult> VerifyConstraintReturnsSafeResultAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token that can cancel the contract validation.
Returns
- ValueTask<ConstraintEvaluationResult>
The verified constraint result.