IntSource

@SourceProvider(value = IntValueSourceDataProvider::class)
annotation class IntSource(val values: IntArray)

Annotation to indicate that the annotated int parameter should be populated with a random value from the provided values array.

Samples

/**
 * This will generate 4 tests with the values 1 - 3, 5
 */
@GeneratedParametersTest
fun testIntSource(@IntSource(values = [1, 2, 3, 5]) value: Int) {
    assertThat(value).isIn(1, 2, 3, 5)
}

Properties

Link copied to clipboard