Companion

object Companion

Functions

Link copied to clipboard
fun assumeFalse(message: String, condition: Boolean)

Reverse of .assumeTrue.

Link copied to clipboard

Assume t is null.

Link copied to clipboard
fun assumeTrue(message: String, condition: Boolean)
Link copied to clipboard
fun between(min: Int, max: Int): Int

An alias for .randomIntBetween.

fun between(min: Long, max: Long): Long

An alias for .randomLongBetween.

Link copied to clipboard

The exact opposite of .rarely.

Link copied to clipboard
fun random(): Random

Shortcut for RandomizedContext.getRandom. Even though this method is static, it returns per-thread Random instance, so no race conditions can occur.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T> randomFrom(array: Array<T>): T

Pick a random object from the given array. The array must not be empty.

Link copied to clipboard
fun randomInt(): Int

fun randomInt(max: Int): Int

A random integer from 0..max (inclusive).

Link copied to clipboard
fun randomIntBetween(min: Int, max: Int): Int

A random integer from min to max (inclusive).

Link copied to clipboard

fun randomLong(max: Long): Long

A random long from 0..max (inclusive).

Link copied to clipboard
fun randomLongBetween(min: Long, max: Long): Long

A random long from min to max (inclusive).

Link copied to clipboard
Link copied to clipboard

Rarely returns true in about 10% of all calls (regardless of the .isNightly mode).

Link copied to clipboard
fun systemPropertyAsBoolean(propertyName: String, defaultValue: Boolean): Boolean
Link copied to clipboard
fun systemPropertyAsInt(propertyName: String, defaultValue: Int): Int