LocalTimeRangeSource
annotation class LocalTimeRangeSource(val min: String, val max: String, val increment: String = "PT1h", val ascending: Boolean = true, val timeFormat: String = "HH:mm")
Annotation to mark that the given LocalTime parameter should be populated with a LocalTime range starting from the minimum value min to the maximum value max with an increment in the direction specified by ascending. The default increment is 1 hour and the default ascending order is true.
Samples
/**
* This will generate tests with random LocalTime values
* between 12:00 and 19:00 with 1 hour increments
*/
@GeneratedParametersTest
fun testLocalTimeRangeSource(
@LocalTimeRangeSource(
min = "12:00",
max = "19:00"
)
value: LocalTime
) {
assertThat(value).isBetween(
LocalTime.parse("12:00"),
LocalTime.parse("19:00")
)
}Content copied to clipboard
Properties
Link copied to clipboard
The maximum value for the LocalTime range. Should be specified in timeFormat
Link copied to clipboard
The minimum value for the LocalTime range. Should be specified in timeFormat
Link copied to clipboard