TestimoX

API Reference

Class

PropertyTestBuilder

Namespace TestimoX.Testing.TestBuilder
Assembly TestimoX

Builder targeting a specific property path for comparisons and filters.

Inheritance

  • Object
  • PropertyTestBuilder

Methods

public TestBuilder AtLeastProperty(String otherPropertyPath) #
Returns: TestBuilder

Alias for GreaterThanOrEqualToProperty.

Parameters

otherPropertyPath System.String requiredposition: 0
public TestBuilder AtLeastWhenPropertyAtLeast(String otherPropertyPath, IComparable secondaryMin, IComparable expectedMin) #
Returns: TestBuilder

Alias of IComparable).

Parameters

otherPropertyPath System.String requiredposition: 0
secondaryMin System.IComparable requiredposition: 1
expectedMin System.IComparable requiredposition: 2
public TestBuilder AtLeastWhenSecondaryAtLeast(String otherPropertyPath, IComparable secondaryMin, IComparable expectedMin) #
Returns: TestBuilder

Requires that the primary property is at least expectedMin when the other property is at least secondaryMin.

Parameters

otherPropertyPath System.String requiredposition: 0
secondaryMin System.IComparable requiredposition: 1
expectedMin System.IComparable requiredposition: 2
public TestBuilder AtMostProperty(String otherPropertyPath) #
Returns: TestBuilder

Alias for LessThanOrEqualToProperty.

Parameters

otherPropertyPath System.String requiredposition: 0
public TestBuilder Between(IComparable min, IComparable max) #
Returns: TestBuilder

Asserts that the current property is between min and max (inclusive). Example: Where("PasswordAgeDays").Between(0, 90)

Parameters

min System.IComparable requiredposition: 0
max System.IComparable requiredposition: 1
public TestBuilder BetweenParameter(String minParameterKey, String maxParameterKey) #
Returns: TestBuilder

Asserts that the current property is between two rule parameters (inclusive). Example: Where("AgeDays").BetweenParameter("MinAgeDays", "MaxAgeDays")

Parameters

minParameterKey System.String requiredposition: 0
maxParameterKey System.String requiredposition: 1
public TestBuilder Contains(String substring, StringComparison comparison = OrdinalIgnoreCase) #
Returns: TestBuilder

Filters to items where the property value contains the given substring (case-insensitive by default).

Parameters

substring System.String requiredposition: 0
comparison System.StringComparison = OrdinalIgnoreCase optionalposition: 1
public TestBuilder CountScale(Action<ScaleBuilder> configure) #
Returns: TestBuilder

Convenience helper for collection properties, using Count by default.

Parameters

configure System.Action{TestimoX.Testing.ScaleBuilder} requiredposition: 0
public TestBuilder EndsWith(String suffix, StringComparison comparison = OrdinalIgnoreCase) #
Returns: TestBuilder

Filters to items where the property value ends with the given suffix (case-insensitive by default).

Parameters

suffix System.String requiredposition: 0
comparison System.StringComparison = OrdinalIgnoreCase optionalposition: 1
public TestBuilder EqualTo(Object value) #
Returns: TestBuilder

Asserts that the current property equals the specified value.

Parameters

value System.Object requiredposition: 0
public TestBuilder EqualToProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property equals the value of otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
public PropertyTestBuilder FilterEquals(String propertyPath, Object value) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath equals value. Works on results root when the source returns a list, or on a collection property.

Parameters

propertyPath System.String requiredposition: 0
value System.Object requiredposition: 1
public PropertyTestBuilder FilterGreaterThan(String propertyPath, Object value) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is greater than value.

Parameters

propertyPath System.String requiredposition: 0
value System.Object requiredposition: 1
public PropertyTestBuilder FilterGreaterThanOrEqual(String propertyPath, Object value) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is greater than or equal to value.

Parameters

propertyPath System.String requiredposition: 0
value System.Object requiredposition: 1
FilterGreaterThanOrEqualParameter 2 overloads
public PropertyTestBuilder FilterGreaterThanOrEqualParameter(String propertyPath, String parameterKey, Object defaultValue) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath ≥ Parameter(parameterKey) or default.

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
defaultValue System.Object requiredposition: 2
public PropertyTestBuilder FilterGreaterThanOrEqualParameter(String propertyPath, String parameterKey) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath ≥ Parameter(parameterKey).

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
FilterGreaterThanParameter 2 overloads
public PropertyTestBuilder FilterGreaterThanParameter(String propertyPath, String parameterKey, Object defaultValue) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath > Parameter(parameterKey) or default.

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
defaultValue System.Object requiredposition: 2
public PropertyTestBuilder FilterGreaterThanParameter(String propertyPath, String parameterKey) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath > Parameter(parameterKey).

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
public PropertyTestBuilder FilterIn(String propertyPath, IEnumerable values) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is contained in values.

Parameters

propertyPath System.String requiredposition: 0
values System.Collections.IEnumerable requiredposition: 1
public PropertyTestBuilder FilterInParameter(String propertyPath, String parameterKey) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is contained in a parameter-provided collection.

Parameters

propertyPath System.String requiredposition: 0
Collection or scalar property path to check.
parameterKey System.String requiredposition: 1
Rule parameter providing the collection.
public PropertyTestBuilder FilterLessThan(String propertyPath, Object value) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is less than value.

Parameters

propertyPath System.String requiredposition: 0
value System.Object requiredposition: 1
public PropertyTestBuilder FilterLessThanOrEqual(String propertyPath, Object value) #
Returns: PropertyTestBuilder

Adds a dataset-level filter: keeps items where propertyPath is less than or equal to value.

Parameters

propertyPath System.String requiredposition: 0
value System.Object requiredposition: 1
FilterLessThanOrEqualParameter 2 overloads
public PropertyTestBuilder FilterLessThanOrEqualParameter(String propertyPath, String parameterKey, Object defaultValue) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath ≤ Parameter(parameterKey) or default.

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
defaultValue System.Object requiredposition: 2
public PropertyTestBuilder FilterLessThanOrEqualParameter(String propertyPath, String parameterKey) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath ≤ Parameter(parameterKey).

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
FilterLessThanParameter 2 overloads
public PropertyTestBuilder FilterLessThanParameter(String propertyPath, String parameterKey, Object defaultValue) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath < Parameter(parameterKey) or default.

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
defaultValue System.Object requiredposition: 2
public PropertyTestBuilder FilterLessThanParameter(String propertyPath, String parameterKey) #
Returns: PropertyTestBuilder

Adds a dataset-level filter using a parameter value: propertyPath < Parameter(parameterKey).

Parameters

propertyPath System.String requiredposition: 0
parameterKey System.String requiredposition: 1
public TestBuilder GreaterOrEqualToPercentOf(String otherPropertyPath, Double percent, Boolean roundUp = true) #
Returns: TestBuilder

Asserts that the current property is greater than or equal to the specified percentage of another property on the same root object.

Parameters

otherPropertyPath System.String requiredposition: 0
percent System.Double requiredposition: 1
roundUp System.Boolean = true optionalposition: 2
public TestBuilder GreaterThan(IComparable value) #
Returns: TestBuilder

Asserts that the current property is greater than the specified value.

Parameters

value System.IComparable requiredposition: 0
public TestBuilder GreaterThanOrEqual(IComparable value) #
Returns: TestBuilder

Asserts that the current property is greater than or equal to the specified value.

Parameters

value System.IComparable requiredposition: 0
GreaterThanOrEqualParameter 2 overloads
public TestBuilder GreaterThanOrEqualParameter(String parameterKey) #
Returns: TestBuilder

Compares the current property to a rule parameter: Property ≥ Parameter(parameterKey).

Parameters

parameterKey System.String requiredposition: 0
public TestBuilder GreaterThanOrEqualParameter(String parameterKey, Object defaultValue) #
Returns: TestBuilder

Compares the current property to a rule parameter (with default): Property ≥ Parameter(parameterKey, defaultValue).

Parameters

parameterKey System.String requiredposition: 0
defaultValue System.Object requiredposition: 1
public TestBuilder GreaterThanOrEqualToProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property is greater than or equal to otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
GreaterThanParameter 2 overloads
public TestBuilder GreaterThanParameter(String parameterKey) #
Returns: TestBuilder

Compares the current property to a rule parameter: Property > Parameter(parameterKey).

Parameters

parameterKey System.String requiredposition: 0
public TestBuilder GreaterThanParameter(String parameterKey, Object defaultValue) #
Returns: TestBuilder

Compares the current property to a rule parameter (with default): Property > Parameter(parameterKey, defaultValue).

Parameters

parameterKey System.String requiredposition: 0
defaultValue System.Object requiredposition: 1
public TestBuilder GreaterThanProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property is greater than otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
public TestBuilder HasAtLeast(Int32 minCount) #
Returns: TestBuilder

Shorthand for HasMinCount.

Parameters

minCount System.Int32 requiredposition: 0
public TestBuilder HasAtMost(Int32 maxCount) #
Returns: TestBuilder

Shorthand for HasMaxCount.

Parameters

maxCount System.Int32 requiredposition: 0
public TestBuilder HasCount(Int32 expectedCount) #
Returns: TestBuilder

Asserts the count equals the specified value. When the path is "$", this compares the results collection size; otherwise it compares path.Count on the current object.

Parameters

expectedCount System.Int32 requiredposition: 0
public TestBuilder HasMaxCount(Int32 maxCount) #
Returns: TestBuilder

Asserts that the collection contains at most maxCount items. Example: Where("WindowsWorkstation10").HasMaxCount(5)

Parameters

maxCount System.Int32 requiredposition: 0
public TestBuilder HasMinCount(Int32 minCount) #
Returns: TestBuilder

Asserts that the collection contains at least minCount items. Example: Where("Entries").HasMinCount(1)

Parameters

minCount System.Int32 requiredposition: 0
public TestBuilder In(params Object[] values) #
Returns: TestBuilder

Asserts that the property value is a member of the provided set.

Parameters

values System.Object[] requiredposition: 0
public TestBuilder IsEmpty() #
Returns: TestBuilder

Asserts that the property value is null, an empty/whitespace string, or an empty collection.

public TestBuilder IsNotEmpty() #
Returns: TestBuilder

Asserts that the property value is non-null, a non-empty string, or a collection with at least one element.

public TestBuilder IsNotNull() #
Returns: TestBuilder

Asserts that the property value is not null.

public TestBuilder IsNull() #
Returns: TestBuilder

Asserts that the property value is null.

public TestBuilder LessOrEqualToPercentOf(String otherPropertyPath, Double percent, Boolean roundUp = true) #
Returns: TestBuilder

Asserts that the current property is less than or equal to the specified percentage of another property on the same root object. Example: Where("PasswordNeverExpires.Count").LessOrEqualToPercentOf("TotalUsers", 1)

Parameters

otherPropertyPath System.String requiredposition: 0
percent System.Double requiredposition: 1
roundUp System.Boolean = true optionalposition: 2
public TestBuilder LessThan(IComparable value) #
Returns: TestBuilder

Asserts that the current property is less than the specified value.

Parameters

value System.IComparable requiredposition: 0
public TestBuilder LessThanOrEqual(IComparable value) #
Returns: TestBuilder

Asserts that the current property is less than or equal to the specified value.

Parameters

value System.IComparable requiredposition: 0
LessThanOrEqualParameter 2 overloads
public TestBuilder LessThanOrEqualParameter(String parameterKey) #
Returns: TestBuilder

Compares the current property to a rule parameter: Property ≤ Parameter(parameterKey).

Parameters

parameterKey System.String requiredposition: 0
public TestBuilder LessThanOrEqualParameter(String parameterKey, Object defaultValue) #
Returns: TestBuilder

Compares the current property to a rule parameter (with default): Property ≤ Parameter(parameterKey, defaultValue).

Parameters

parameterKey System.String requiredposition: 0
defaultValue System.Object requiredposition: 1
public TestBuilder LessThanOrEqualToProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property is less than or equal to otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
LessThanParameter 2 overloads
public TestBuilder LessThanParameter(String parameterKey) #
Returns: TestBuilder

Compares the current property to a rule parameter: Property < Parameter(parameterKey).

Parameters

parameterKey System.String requiredposition: 0
public TestBuilder LessThanParameter(String parameterKey, Object defaultValue) #
Returns: TestBuilder

Compares the current property to a rule parameter (with default): Property < Parameter(parameterKey, defaultValue).

Parameters

parameterKey System.String requiredposition: 0
defaultValue System.Object requiredposition: 1
public TestBuilder LessThanProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property is less than otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
public TestBuilder Matches(String pattern) #
Returns: TestBuilder

Filters to items where the property value matches the provided regular expression pattern.

Parameters

pattern System.String requiredposition: 0
public TestBuilder NotEquals(Object value) #
Returns: TestBuilder

Asserts that the current property does not equal the specified value.

Parameters

value System.Object requiredposition: 0
public TestBuilder NotEqualToProperty(String otherPropertyPath) #
Returns: TestBuilder

Asserts that the property is different from the value of otherPropertyPath.

Parameters

otherPropertyPath System.String requiredposition: 0
public TestBuilder NotIn(params Object[] values) #
Returns: TestBuilder

Asserts that the property value is not a member of the provided set.

Parameters

values System.Object[] requiredposition: 0
public TestBuilder StartsWith(String prefix, StringComparison comparison = OrdinalIgnoreCase) #
Returns: TestBuilder

Filters to items where the property value starts with the given prefix (case-insensitive by default).

Parameters

prefix System.String requiredposition: 0
comparison System.StringComparison = OrdinalIgnoreCase optionalposition: 1
public TestBuilder WithScale(Action<ScaleBuilder> configure, Boolean useCountIfCollection = true) #
Returns: TestBuilder

Defines a multi-band threshold scale for this property. Bands are matched in order. If the property is a collection and useCountIfCollection is true, Count is compared. Example: Where("WindowsWorkstation10").CountScale(s => s.UpTo(5, TestimoStatus.Good).UpTo(10, TestimoStatus.Elevated).Above(10, TestimoStatus.Severe))

Parameters

configure System.Action{TestimoX.Testing.ScaleBuilder} requiredposition: 0
useCountIfCollection System.Boolean = true optionalposition: 1