TestCase<INPUT extends Object?, OUTPUT extends Object?> class

One of the cases in Test.

Example:

void main() {
  TestCase(
    when: 'Positive Border height value',
    then: 'outputs value in m',
    input: 1.0,
    matcher: equals('0.01 m'),
    action: (double input) => Height(input).toStringInMetre(),
  ).execute();
}
Implementers

Constructors

TestCase({required String when, required String then, required INPUT input, required dynamic matcher, ParameterizedCallback<INPUT, OUTPUT>? action, String? testOn, Timeout? timeout, dynamic skip, dynamic tags, Map<String, dynamic>? onPlatform, int? retry})
action is optional. Do not provide action, if the TestCase is executed in a TestGroup.

Properties

action → ParameterizedCallback<INPUT, OUTPUT>?
Provided only if the TestCase is executed without a TestGroup. If TestGroup is provided, the common action is run by just varying the input.
final
description String
You can extend this class and override this field.
no setter
descriptionDelimiter String
descriptionDelimiter is defaulted to this class. You can extend this class and override this field.
final
hashCode int
The hash code for this object.
no setterinherited
input → INPUT
Input value for the test case. The type is provided as a generic.
final
matcher → dynamic
Custom output matcher for the test case. Sent as such to the test function.
final
onPlatform Map<String, dynamic>?
Direct forward to test function
final
retry int?
Direct forward to test function
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skip → dynamic
Direct forward to test function
final
tags → dynamic
Direct forward to test function
final
testOn String?
Direct forward to test function
final
then String
'then' part of the description.
final
timeout Timeout?
Direct forward to test function
final
when String
'when' part of the description.
final

Methods

copyWith(ParameterizedCallback<INPUT, OUTPUT> action) TestCase<INPUT, OUTPUT>
copyWith is used internally by the TestGroup.
execute() → void
Wrapper to the test function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited