All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wesleyhome.test.jupiter.provider.datetime.LocalDateTimeRangeDataProvider.kt Maven / Gradle / Ivy

Go to download

Library to help generate test parameter permutations for parameterized tests in JUnit. This version is an initial attempt to convert to building with Gradle.

The newest version!
package com.wesleyhome.test.jupiter.provider.datetime

import com.wesleyhome.test.jupiter.annotations.datetime.LocalDateTimeRangeSource
import com.wesleyhome.test.jupiter.step
import com.wesleyhome.test.jupiter.toLocalDateTime
import java.time.LocalDateTime

internal class LocalDateTimeRangeDataProvider :
    AbstractAnnotatedDateTimeRangeDataProvider() {
    override val formatPropertyName: String = "dateTimeFormat"

    override fun toList(min: LocalDateTime, max: LocalDateTime, increment: String): List =
        (min..max step increment).toList()

    override fun convert(value: String, format: String): LocalDateTime = value.toLocalDateTime(format)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy