Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (23 loc) · 626 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 626 Bytes

Esito

Esito test utilities.

Installation

repositories {
	maven { url 'https://jitpack.io' }
}

dependencies {
    testImplementation("com.github.Subito-it.Esito:test:(insert latest version)")
}

Usage

Esito is providing two extension methods to facilitate testing: assertIsSuccess and assertIsFailure, here is an example of usage:

val success = Result.success<Int, Throwable>(42)
success.assertIsSuccess {
    assertEquals(42, value)
}

val failure = Result.failure<Int, RuntimeException>(RuntimeException("Ops"))
failure.assertIsFailure {
    assertEquals("Ops", error.message)
}