Created
March 26, 2022 17:33
-
-
Save supermanue/74d13beb72f62b80942e19c2dd6dc6ca to your computer and use it in GitHub Desktop.
Fixture testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FixturesTest extends DefaultRunnableSpec with DomainFixtures { | |
def spec: ZSpec[TestEnvironment, Failure] = | |
suite("Fixtures test")( | |
testM("positiveIntGen generates positive ints") { | |
check(positiveIntGen) { positiveInt => | |
assert(positiveInt > 0)(isTrue) | |
} | |
}, | |
testM("nonemptyStringGen generates nonempty strings") { | |
check(nonemptyStringGen) { nonemptyString => | |
assert(nonemptyString.nonEmpty)(isTrue) | |
} | |
}, | |
testM("userGen builds valid users") { | |
check(userGen) { user => | |
assert(Try(user))(isSuccess) | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment