Class GovernanceTestHarnessOptions
- Namespace
- AsiBackbone.Testing
- Assembly
- AsiBackbone.Testing.dll
Configures deterministic services for exercising AsiBackbone-governed endpoints in tests.
public sealed class GovernanceTestHarnessOptions
- Inheritance
-
GovernanceTestHarnessOptions
- Inherited Members
Properties
DefaultCapabilityGrantDecision
Gets the default capability-grant validation decision used by the test harness.
public GovernanceDecision DefaultCapabilityGrantDecision { get; }
Property Value
DefaultPolicyDecision
Gets the default policy decision used when no explicit policy result is configured.
public GovernanceDecision DefaultPolicyDecision { get; }
Property Value
PolicyResults
Gets the configured deterministic policy results.
public IReadOnlyDictionary<string, GovernanceDecision> PolicyResults { get; }
Property Value
RegisterDeterministicSigningService
Gets or sets a value indicating whether the harness registers a deterministic no-signature signing service.
public bool RegisterDeterministicSigningService { get; set; }
Property Value
RegisterInMemoryAuditSink
Gets or sets a value indicating whether the harness registers GovernanceTestDecisionReceiptSink as the host decision receipt sink.
public bool RegisterInMemoryAuditSink { get; set; }
Property Value
RegisterInMemoryOutboxStore
Gets or sets a value indicating whether the harness registers the non-durable in-memory outbox store.
public bool RegisterInMemoryOutboxStore { get; set; }
Property Value
RequireExplicitPolicyResults
Gets a value indicating whether every policy marker must have an explicit configured result.
public bool RequireExplicitPolicyResults { get; }
Property Value
Methods
AllowAllPolicies()
Uses an allow decision as the default policy result.
public GovernanceTestHarnessOptions AllowAllPolicies()
Returns
AllowCapabilityGrants()
Uses an allow decision as the default capability-grant validation result.
public GovernanceTestHarnessOptions AllowCapabilityGrants()
Returns
DenyAllPolicies(string, string)
Uses a deny decision as the default policy result.
public GovernanceTestHarnessOptions DenyAllPolicies(string code = "test_harness.policy_denied", string message = "Denied by the AsiBackbone test harness.")
Parameters
Returns
DenyCapabilityGrants(string, string)
Uses a deny decision as the default capability-grant validation result.
public GovernanceTestHarnessOptions DenyCapabilityGrants(string code = "test_harness.capability_denied", string message = "Capability grant denied by the AsiBackbone test harness.")
Parameters
Returns
RequirePolicyResult(Type, GovernanceDecision)
Requires explicit deterministic policy results and configures the supplied marker type.
public GovernanceTestHarnessOptions RequirePolicyResult(Type policyType, GovernanceDecision decision)
Parameters
policyTypeTypedecisionGovernanceDecision
Returns
RequirePolicyResult<TPolicy>(GovernanceDecision)
Requires explicit deterministic policy results and configures the supplied marker type.
public GovernanceTestHarnessOptions RequirePolicyResult<TPolicy>(GovernanceDecision decision)
Parameters
decisionGovernanceDecision
Returns
Type Parameters
TPolicy
SetPolicyResult(Type, GovernanceDecision)
Sets a deterministic result for a policy marker type.
public GovernanceTestHarnessOptions SetPolicyResult(Type policyType, GovernanceDecision decision)
Parameters
policyTypeTypeThe policy marker type to configure a result for.
decisionGovernanceDecisionThe decision the harness returns for endpoints marked with that type.
Returns
- GovernanceTestHarnessOptions
The same options instance so calls can be chained.
Remarks
This is a harness-only capability. It simulates a host-supplied decision policy that reads the
endpoint.policy_types metadata entry and varies its outcome by policy type. AsiBackbone itself does not
select constraints or decisions from an endpoint's policy type, so configuring different results for two policy
types asserts against host policy the application must actually implement. Without that host decision policy,
both endpoints evaluate identically at runtime.
SetPolicyResult<TPolicy>(GovernanceDecision)
Sets a deterministic result for a policy marker type.
public GovernanceTestHarnessOptions SetPolicyResult<TPolicy>(GovernanceDecision decision)
Parameters
decisionGovernanceDecision
Returns
Type Parameters
TPolicy