com.rapatao.projects.ruleset.engine.cases.InvalidOperatorCases.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tests Show documentation
Show all versions of tests Show documentation
Simple yet powerful rules engine that offers the flexibility of using the built-in engine and creating a custom one.
The newest version!
package com.rapatao.projects.ruleset.engine.cases
import com.rapatao.projects.ruleset.engine.types.Expression
import com.rapatao.projects.ruleset.engine.types.OnFailure
import org.junit.jupiter.params.provider.Arguments
object InvalidOperatorCases {
fun cases(): List = listOf(
// missing operator
Arguments.of(
Expression(left = true, right = true, onFailure = OnFailure.FALSE),
false,
),
Arguments.of(
Expression(left = true, right = true, onFailure = OnFailure.TRUE),
true,
),
Arguments.of(
Expression(left = true, right = true, onFailure = OnFailure.THROW),
false,
),
// not declared operator
Arguments.of(
Expression(left = true, right = true, operator = "_non-existing_", onFailure = OnFailure.FALSE),
false,
),
Arguments.of(
Expression(left = true, right = true, operator = "_non-existing_", onFailure = OnFailure.TRUE),
true,
),
Arguments.of(
Expression(left = true, right = true, operator = "_non-existing_", onFailure = OnFailure.THROW),
false,
),
)
}