| Modifier and Type | Method and Description |
|---|---|
Gen<java.math.BigInteger> |
bigInteger(int maxNumBits) |
<A,T> Gen<T> |
bind(Gen<A> gena,
kotlin.jvm.functions.Function1<? super A,? extends T> createFn) |
<A,B,T> Gen<T> |
bind(Gen<A> gena,
Gen<B> genb,
kotlin.jvm.functions.Function2<? super A,? super B,? extends T> createFn) |
<A,B,C,T> Gen<T> |
bind(Gen<A> gena,
Gen<B> genb,
Gen<C> genc,
kotlin.jvm.functions.Function3<? super A,? super B,? super C,? extends T> createFn) |
<A,B,C,D,T> |
bind(Gen<A> gena,
Gen<B> genb,
Gen<C> genc,
Gen<D> gend,
kotlin.jvm.functions.Function4<? super A,? super B,? super C,? super D,? extends T> createFn) |
<A,B,C,D,E,T> |
bind(Gen<A> gena,
Gen<B> genb,
Gen<C> genc,
Gen<D> gend,
Gen<E> gene,
kotlin.jvm.functions.Function5<? super A,? super B,? super C,? super D,? super E,? extends T> createFn) |
<A,B,C,D,E,F,T> |
bind(Gen<A> gena,
Gen<B> genb,
Gen<C> genc,
Gen<D> gend,
Gen<E> gene,
Gen<F> genf,
kotlin.jvm.functions.Function6<? super A,? super B,? super C,? super D,? super E,? super F,? extends T> createFn) |
<A,B,C,D,E,F,G,T> |
bind(Gen<A> gena,
Gen<B> genb,
Gen<C> genc,
Gen<D> gend,
Gen<E> gene,
Gen<F> genf,
Gen<G> geng,
kotlin.jvm.functions.Function7<? super A,? super B,? super C,? super D,? super E,? super F,? super G,? extends T> createFn) |
Gen<java.lang.Boolean> |
bool()
Returns both boolean values
|
Gen<java.lang.Integer> |
choose(int min,
int max)
Returns a stream of values, where each value is
a random Int between the given min and max.
|
Gen<java.lang.Long> |
choose(long min,
long max)
Returns a stream of values, where each value is a
Long between the given min and max.
|
<T> Gen<T> |
constant(T value)
Returns a [
interface Gen] which always returns the same value. |
<T> Gen<T> |
create(kotlin.jvm.functions.Function0<? extends T> fn)
Returns a stream of values, where each
value is generated from the given function
|
Gen<java.lang.Double> |
double()
Returns a stream of values where each value is a randomly
chosen Double.
|
Gen<java.time.Duration> |
duration(java.time.Duration maxDuration)
Generates a stream of random Durations
|
Gen<java.io.File> |
file()
Returns a stream of values where each value is a randomly
chosen created File object. The file objects do not necessarily
exist on disk.
|
Gen<java.lang.Float> |
float()
Returns a stream of values where each value is a randomly
chosen Float.
|
Gen<?> |
forClassName(java.lang.String className) |
<T> Gen<T> |
from(java.util.List<? extends T> values)
Adapts a list into a generator, where random
values will be picked. May not choose every
item in the list.
|
<T> Gen<T> |
from(T[] values) |
Gen<java.lang.Integer> |
int()
Returns a stream of values where each value is a randomly
chosen Int. The values always returned include
the following edge cases: Int.MIN_VALUE,Int.MAX_VALUE,0
|
<T> Gen<java.util.List> |
list(Gen<T> gen)
Returns a stream of values, where each value is
a list of values generated by the underlying generator.
|
Gen<java.time.LocalDate> |
localDate(int minYear,
int maxYear)
Generates a stream of random LocalDates
|
Gen<java.time.LocalDateTime> |
localDateTime(int minYear,
int maxYear)
Generates a stream of random LocalDateTimes
|
Gen<java.time.LocalTime> |
localTime()
Generates a stream of random LocalTimes
|
Gen<java.lang.Long> |
long()
Returns a stream of values where each value is a randomly
chosen long. The values returned always include
the following edge cases: Long.MIN_VALUE,Long.MAX_VALUE
|
<K,V> Gen<java.util.Map> |
map(Gen<K> genK,
Gen<V> genV)
Returns a stream of values, where each value is
a Map, which contains keys and values generated
from the underlying generators.
|
Gen<java.lang.Integer> |
nats()
Returns a stream of values where each value is a randomly
chosen natural number. The values returned always include
the following edge cases: Int.MAX_VALUE
|
Gen<java.lang.Double> |
negativeDoubles() |
Gen<java.lang.Integer> |
negativeIntegers()
Returns a stream of values where each value is a randomly
chosen negative value. The values returned always include
the following edge cases: Int.MIN_VALUE
|
Gen<java.lang.Double> |
numericDoubles(double from,
double to)
Returns a
interface Gen which is the same as Gen.Companion.double but does not include +INFINITY, -INFINITY or NaN. |
Gen<java.lang.Float> |
numericFloats(float from,
float to)
Returns a
interface Gen which is the same as Gen.Companion.float but does not include +INFINITY, -INFINITY or NaN. |
<A> Gen<A> |
oneOf(io.kotlintest.properties.Gen gens) |
<K,V> Gen<kotlin.Pair> |
pair(Gen<K> genK,
Gen<V> genV)
Returns a stream of values, where each value is
a pair generated by the underlying generators.
|
Gen<java.time.Period> |
period(int maxYear)
Generates a stream of random Periods
|
Gen<java.lang.Double> |
positiveDoubles() |
Gen<java.lang.Integer> |
positiveIntegers()
Returns a stream of values where each value is a randomly
chosen positive value. The values returned always include
the following edge cases: Int.MAX_VALUE
|
<T> Gen<java.util.Set> |
set(Gen<T> gen)
Returns a stream of values, where each value is
a set of values generated by the given generator.
|
Gen<java.lang.String> |
string()
Returns a stream of values where each value is a random
printed string.
|
<A,B,C> Gen<kotlin.Triple> |
triple(Gen<A> genA,
Gen<B> genB,
Gen<C> genC)
Returns a [
interface Gen] where each value is a [Triple] generated
by a value from each of three supplied generators. |
Gen<java.util.UUID> |
uuid() |
public <A,T> Gen<T> bind(Gen<A> gena, kotlin.jvm.functions.Function1<? super A,? extends T> createFn)
public <A,B,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, kotlin.jvm.functions.Function2<? super A,? super B,? extends T> createFn)
public <A,B,C,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, Gen<C> genc, kotlin.jvm.functions.Function3<? super A,? super B,? super C,? extends T> createFn)
public <A,B,C,D,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, Gen<C> genc, Gen<D> gend, kotlin.jvm.functions.Function4<? super A,? super B,? super C,? super D,? extends T> createFn)
public <A,B,C,D,E,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, Gen<C> genc, Gen<D> gend, Gen<E> gene, kotlin.jvm.functions.Function5<? super A,? super B,? super C,? super D,? super E,? extends T> createFn)
public <A,B,C,D,E,F,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, Gen<C> genc, Gen<D> gend, Gen<E> gene, Gen<F> genf, kotlin.jvm.functions.Function6<? super A,? super B,? super C,? super D,? super E,? super F,? extends T> createFn)
public <A,B,C,D,E,F,G,T> Gen<T> bind(Gen<A> gena, Gen<B> genb, Gen<C> genc, Gen<D> gend, Gen<E> gene, Gen<F> genf, Gen<G> geng, kotlin.jvm.functions.Function7<? super A,? super B,? super C,? super D,? super E,? super F,? super G,? extends T> createFn)
public <A> Gen<A> oneOf(io.kotlintest.properties.Gen gens)
public Gen<java.math.BigInteger> bigInteger(int maxNumBits)
public Gen<java.lang.Integer> choose(int min, int max)
Returns a stream of values, where each value is a random Int between the given min and max.
public Gen<java.lang.Long> choose(long min, long max)
Returns a stream of values, where each value is a Long between the given min and max.
public <T> Gen<T> from(java.util.List<? extends T> values)
Adapts a list into a generator, where random values will be picked. May not choose every item in the list.
public <T> Gen<T> from(T[] values)
public Gen<java.lang.String> string()
Returns a stream of values where each value is a random printed string.
The constant values are: The empty string A line separator Multi-line string a UTF8 string.
public Gen<java.lang.Integer> int()
Returns a stream of values where each value is a randomly chosen Int. The values always returned include the following edge cases: Int.MIN_VALUE,Int.MAX_VALUE,0
public Gen<java.lang.Integer> positiveIntegers()
Returns a stream of values where each value is a randomly chosen positive value. The values returned always include the following edge cases: Int.MAX_VALUE
public Gen<java.lang.Integer> nats()
Returns a stream of values where each value is a randomly chosen natural number. The values returned always include the following edge cases: Int.MAX_VALUE
public Gen<java.lang.Integer> negativeIntegers()
Returns a stream of values where each value is a randomly chosen negative value. The values returned always include the following edge cases: Int.MIN_VALUE
public Gen<java.io.File> file()
Returns a stream of values where each value is a randomly chosen created File object. The file objects do not necessarily exist on disk.
public Gen<java.lang.Long> long()
Returns a stream of values where each value is a randomly chosen long. The values returned always include the following edge cases: Long.MIN_VALUE,Long.MAX_VALUE
public Gen<java.lang.Boolean> bool()
Returns both boolean values
public Gen<java.util.UUID> uuid()
public Gen<java.time.LocalDate> localDate(int minYear, int maxYear)
Generates a stream of random LocalDates
This generator creates randomly generated LocalDates, in the range [minYear,maxYear].
If any of the years in the range contain a leap year, the date 29/02/YEAR will always be a constant value of this generator.
public Gen<java.time.LocalTime> localTime()
Generates a stream of random LocalTimes
This generator creates randomly generated LocalTimes.
public Gen<java.time.LocalDateTime> localDateTime(int minYear, int maxYear)
Generates a stream of random LocalDateTimes
This generator creates randomly generated LocalDates, in the range [minYear,maxYear].
If any of the years in the range contain a leap year, the date 29/02/YEAR will always be a constant value of this generator.
public Gen<java.time.Duration> duration(java.time.Duration maxDuration)
Generates a stream of random Durations
This generator creates randomly generated Duration, of at most maxDuration.
public Gen<java.time.Period> period(int maxYear)
public Gen<java.lang.Double> double()
Returns a stream of values where each value is a randomly chosen Double.
public Gen<java.lang.Double> numericDoubles(double from, double to)
Returns a interface Gen which is the same as Gen.Companion.double but does not include +INFINITY, -INFINITY or NaN.
This will only generate numbers ranging from from (inclusive) to to (inclusive)
interface Gen,
Gen.Companion.doublepublic Gen<java.lang.Double> positiveDoubles()
public Gen<java.lang.Double> negativeDoubles()
public Gen<java.lang.Float> float()
Returns a stream of values where each value is a randomly chosen Float.
public Gen<java.lang.Float> numericFloats(float from, float to)
Returns a interface Gen which is the same as Gen.Companion.float but does not include +INFINITY, -INFINITY or NaN.
This will only generate numbers ranging from from (inclusive) to to (inclusive)
interface Gen,
Gen.Companion.floatpublic <T> Gen<T> create(kotlin.jvm.functions.Function0<? extends T> fn)
Returns a stream of values, where each value is generated from the given function
public <T> Gen<java.util.Set> set(Gen<T> gen)
Returns a stream of values, where each value is a set of values generated by the given generator.
public <T> Gen<java.util.List> list(Gen<T> gen)
Returns a stream of values, where each value is a list of values generated by the underlying generator.
public <K,V> Gen<kotlin.Pair> pair(Gen<K> genK, Gen<V> genV)
Returns a stream of values, where each value is a pair generated by the underlying generators.
public <A,B,C> Gen<kotlin.Triple> triple(Gen<A> genA, Gen<B> genB, Gen<C> genC)
Returns a [interface Gen] where each value is a [Triple] generated
by a value from each of three supplied generators.
interface Gen,
Triplepublic <K,V> Gen<java.util.Map> map(Gen<K> genK, Gen<V> genV)
Returns a stream of values, where each value is a Map, which contains keys and values generated from the underlying generators.
public <T> Gen<T> constant(T value)
Returns a [interface Gen] which always returns the same value.
interface Genpublic Gen<?> forClassName(java.lang.String className)