TestimoX

API Reference

Class

TestBuilder

Namespace TestimoX.Testing
Assembly TestimoX

Fluent test builder used by rules to craft assertions over results. Split into partials for property/object helpers.

Inheritance

  • Object
  • TestBuilder

Constructors

public TestBuilder(String name = null) #

Creates a new fluent test builder.

Parameters

name System.String = null optionalposition: 0
Optional test display name.

Methods

public Test Build() #
Returns: Test

Materializes the configured test.

public TestBuilder Enabled(Boolean enabled = true) #
Returns: TestBuilder

Enables or disables this test.

Parameters

enabled System.Boolean = true optionalposition: 0
public TestBuilder ExpectCount(Int32 expected) #
Returns: TestBuilder

Asserts the dataset-level count equals the specified value.

Parameters

expected System.Int32 requiredposition: 0
public TestBuilder Named(String name) #
Returns: TestBuilder

Sets/overrides the test display name (supports {Param} interpolation at render time).

Parameters

name System.String requiredposition: 0
public TestBuilder RequiresAction(ActionType action) #
Returns: TestBuilder

Marks the remediation action level for this test.

Parameters

action TestimoX.Definitions.ActionType requiredposition: 0
public TestBuilder WhenFalse(TestimoStatus status, String message = null) #
Returns: TestBuilder

Status applied when the assertion evaluates to false. Optional message template replaces generic outputs.

Parameters

status TestimoX.Definitions.TestimoStatus requiredposition: 0
Status when the test fails.
message System.String = null optionalposition: 1
Optional friendly message shown on fail (supports {Actual}/{Expected} and {Param} tokens).
public TestBuilder WhenTrue(TestimoStatus status, String message = null) #
Returns: TestBuilder

Status applied when the assertion evaluates to true. Optional message template replaces generic outputs.

Parameters

status TestimoX.Definitions.TestimoStatus requiredposition: 0
Status when the test passes.
message System.String = null optionalposition: 1
Optional friendly message shown on pass (supports {Param} tokens).
public PropertyTestBuilder Where(String propertyPath) #
Returns: PropertyTestBuilder

Targets a property path for subsequent comparisons/filters.

Parameters

propertyPath System.String requiredposition: 0
public ObjectTestBuilder WhereObject() #
Returns: ObjectTestBuilder

Targets the whole object for predicate-based checks.

public PropertyTestBuilder WhereResults() #
Returns: PropertyTestBuilder

Targets the results collection (root) for dataset-level filters and counts.

public TestBuilder WithDescription(String description) #
Returns: TestBuilder

Optional description or extended value shown by renderers.

Parameters

description System.String requiredposition: 0
public TestBuilder WithImportance(Importance importance) #
Returns: TestBuilder

Sets the importance level used by renderers and scoring.

Parameters

importance TestimoX.Definitions.Importance requiredposition: 0
public TestBuilder WithOutcomeMessages(String onPass = null, String onFail = null) #
Returns: TestBuilder

Set friendly messages shown on pass/fail instead of generic texts.

Parameters

onPass System.String = null optionalposition: 0
onFail System.String = null optionalposition: 1
public TestBuilder WithScoreKind(ScoreKind kind) #
Returns: TestBuilder

Set scoring domain override for this test.

Parameters

kind TestimoX.Definitions.ScoreKind requiredposition: 0
public TestBuilder WithWeight(Double weight) #
Returns: TestBuilder

Adjusts the scoring weight for this test. A value of 1.0 keeps default impact; values > 1.0 increase penalty impact when the test fails; values between 0 and 1 reduce impact.

Parameters

weight System.Double requiredposition: 0
Multiplier applied to penalty units (must be positive).