net.corda.contracts.testing / ContractStateGenerator

# ContractStateGenerator

`class ContractStateGenerator`

This file contains generators for quickcheck style testing. The idea is that we can write random instance generators for each type we have in the code and test against those instead of predefined mock data. This style of testing can catch corner case bugs and test algebraic properties of the code, for example deserialize(serialize(generatedThing)) == generatedThing

TODO add combinators for easier Generator writing

### Constructors

<init> | `ContractStateGenerator()` This file contains generators for quickcheck style testing. The idea is that we can write random instance generators for each type we have in the code and test against those instead of predefined mock data. This style of testing can catch corner case bugs and test algebraic properties of the code, for example deserialize(serialize(generatedThing)) == generatedThing

### Functions

generate | `fun generate(random: <ERROR CLASS>, status: <ERROR CLASS>): ContractState`