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 BDTestOptions | Description |
|---|---|
Debug.ShouldSkipWhenStep | Skip every When step. See Debugging tests. |
SuccessExceptionTypes, SkipExceptionTypes, InconclusiveExceptionTypes | Exception classification. |
RegisterFrameworkOutcomes(map) | Register framework exception types and outcome callbacks. |
RegisterCustomStringConverter<T>(converter) | Add a typed converter. See Step text. |
SkipStepRules | Attribute-based predicates; see Skipping. |
SkipTestRules | Predicates evaluated once before scenario execution; a predicate error fails without retrying. |
RetryTestRules | Default exception predicates and retry limits, replaced by explicit retry attributes; see Retries. |
StepHooks | Ordered IStepHook instances; see Step hooks. |
ScenarioHooks | Ordered IScenarioHook instances; see Scenario hooks. |
ContextFactory, Services | Context creation. |
Attachments | Capture 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
// 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.