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

com.rapatao.projects.ruleset.engine.cases.InvalidOperatorCases.kt Maven / Gradle / Ivy

Go to download

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,
        ),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy