Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 964 Bytes

README.adoc

File metadata and controls

30 lines (25 loc) · 964 Bytes

Kotest integration

build.gradle.kts
// Add for Kotest integration
testImplementation("com.appmattus.fixture:fixture-kotest:<latest-version>")

Kotest supports property testing, but to use it with more than just the few basic types built into the library requires you to create your own custom generators which you then provide.

Including the fixture-kotest dependency in your project adds extension functions checkAll and forAll to the fixture. These functions wrap the equivalent functions from Kotest while providing generation of all the classes KotlinFixture supports. For example:

data class Person(name: String, age: Int)

fixture.checkAll { person1: Person, person2: Person ->
   person1 shouldNotBeSameInstanceAs person2
}