Skip to main content

Settings

Built-in adapters use assembly configuration. Standalone callers configure BDTestOptions before BDTestRun.Start(options). Every run freezes its registrations at startup. There is no process-wide settings object or default run.

Reference​

Member on BDTestOptionsDescription
Debug.ShouldSkipWhenStepSkip every When step. See Debugging tests.
SuccessExceptionTypes, SkipExceptionTypes, InconclusiveExceptionTypesException classification.
RegisterFrameworkOutcomes(map)Register framework exception types and outcome callbacks.
RegisterCustomStringConverter<T>(converter)Add a typed converter. See Step text.
SkipStepRulesAttribute-based predicates; see Skipping.
SkipTestRulesPredicates evaluated once before scenario execution; a predicate error fails without retrying.
RetryTestRulesDefault exception predicates and retry limits, replaced by explicit retry attributes; see Retries.
StepHooksOrdered IStepHook instances; see Step hooks.
ScenarioHooksOrdered IScenarioHook instances; see Scenario hooks.
ContextFactory, ServicesContext creation.
AttachmentsCapture limits.
TimeProvider (.NET 8+)Execution clock.

Put report labels and custom properties on BDTestRunDescriptor, passed to report helpers. See migration from global settings.

Debugging tests​

Illustrative fragment
// Inside IBDTestConfiguration.Configure(BDTestOptions options):
options.Debug.ShouldSkipWhenStep = true;

When true, BDTest does not execute When steps (including And and But steps in the When phase). Use it to find tests that do not test what you think they test:

  • With the action skipped, you would expect every test to fail.
  • A test that still passes is probably not asserting on the result of its action.

Scenarios with skipped When steps and passing Then steps are reported as Passed, so look for passes in the report. Use this setting only while checking your tests; do not commit it.

Thread safety​

Configure options before starting a run, without concurrent mutations. Later registration changes affect only newly started runs. Callback, converter and hook instances are copied by reference, so protect their mutable state when tests run concurrently. Keep their resources alive until the run has finished.