public interface Subcase<T>
Case. When the fuzzy engine is determining how many
test cases to execute, it treats subcases as
equivalency classes: although an individual
subcase's return value can vary randomly, it assumes that all values it can return are effectively equal.| Modifier and Type | Method and Description |
|---|---|
default void |
describeTo(StringBuilder sink,
T value)
Describes a given output produced by this subcase, for use in test failure reports.
|
T |
generate(Random random)
Instructs the subcase to generate and return a new value.
|
T generate(Random random)
Subcases are not required to return exactly the same value for subsequent calls to generate; they may
randomly adjust their output on a per-call basis. However, subcases should adhere to the expectation that they
represent an equivalency class of output: although individual return values may differ, each value they
produce is effectively the same from a testing perspective.
If the subcase does chose to produce randomized values, it should do so deterministically: two calls provided with a random number generator with the same seed should produce exactly the same output. In general, this condition should be satisfied if the test uses the provided random number generator as its only source of randomness.
default void describeTo(StringBuilder sink, T value)
The default implementation of this method attempts to provide helpful descriptions of null, common
primitives, strings, arrays, and collections. It defers to Object.toString() for all other descriptions.
sink - the string builder to which the description of the value should be appended.value - the value (as returned by this subcase's generate method) that should be
described.Copyright © 2017 Redfin. All rights reserved.