test_case_combinator library
A small library with no dependencies that simplifies writing tests where verifying all possible combinations of the input parameters is required.
An example would be a function like this:
bool isAll(bool a1, bool a2, bool a3, bool a4, bool a6) {
return a1 && a2 && a3 && a4 && a5 && a6;
}
To fully test the function above you would need 32
test cases, where
only one is expected to produce the true
result. That is a lot of test cases
to write, and it is easy to make a typo on the way.
This library allows easily solving a task like that by allowing all test cases to be generated automatically from combinations of the input parameters.
Classes
-
TestCaseCombinator<
T> - Builder for test cases based on all possible combinations of the input arguments.
Typedefs
-
TestCaseCombinatorArgument<
T> = (Iterable, T Function(T, dynamic)) -
An argument for TestCaseCombinator, that provides the values
the argument could take, and a function which applies a particular
value to the resulting test case
T
.