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

run.qontract.test.ResultAssert.kt Maven / Gradle / Ivy

There is a newer version: 0.23.1
Show newest version
package run.qontract.test

import org.assertj.core.api.AbstractAssert
import run.qontract.core.Result
import run.qontract.core.resultReport

class ResultAssert(result: Result) : AbstractAssert(result, ResultAssert::class.java) {
    companion object {
        fun assertThat(actual: Result): ResultAssert {
            return ResultAssert(actual)
        }
    }

    fun isSuccess() {
        isNotNull

        if(actual is Result.Failure) {
            failWithMessage(resultReport(actual, "Testing scenario"))
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy