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

main.kotlin.ch.tutteli.atrium.logic.impl.DefaultComparableAssertions.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package ch.tutteli.atrium.logic.impl

import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.creating.AssertionContainer
import ch.tutteli.atrium.logic.ComparableAssertions
import ch.tutteli.atrium.logic.createDescriptiveAssertion
import ch.tutteli.atrium.translations.DescriptionComparableExpectation.*

class DefaultComparableAssertions : ComparableAssertions {

    override fun , T2 : Any?> isLessThan(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(TO_BE_LESS_THAN, expected) { it < expected }

    override fun , T2 : Any?> isLessThanOrEqual(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(TO_BE_LESS_THAN_OR_EQUAL_TO, expected) { it <= expected }

    override fun , T2 : Any?> isNotGreaterThan(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(NOT_TO_BE_GREATER_THAN, expected) { it <= expected }

    override fun , T2 : Any?> isEqualComparingTo(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(TO_BE_EQUAL_COMPARING_TO, expected) { it.compareTo(expected) == 0 }


    override fun , T2 : Any?> isGreaterThanOrEqual(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(TO_BE_GREATER_THAN_OR_EQUAL_TO, expected) { it >= expected }

    override fun , T2 : Any?> isNotLessThan(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(NOT_TO_BE_LESS_THAN, expected) { it >= expected }


    override fun , T2 : Any?> isGreaterThan(
        container: AssertionContainer,
        expected: T2
    ): Assertion = container.createDescriptiveAssertion(TO_BE_GREATER_THAN, expected) { it > expected }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy