Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can focus on writing tests instead of spending time and effort to setup test data
Made random provider configurable, e.g InstantiatorConfig(random = Random(0))
The reasoning behind this PR is that a use case for this library would be something akin to snapshot-testing.
@Test
fun `test mapper of large object`() {
val value = instance<SomeLargeObject>(InstantiatorConfig(random = Random(0))
val mappedValue = mapper(value)
snapshot.assertMatches(mappedValue);
}
But it would require the randomness to be stable across test runs.
What was added?
Made random provider configurable, e.g
InstantiatorConfig(random = Random(0))
The reasoning behind this PR is that a use case for this library would be something akin to snapshot-testing.But it would require the randomness to be stable across test runs.