# How to get scalacheck to test all combinations

From the printouts i see this code just does 10 random sampling of of combinations of 3 boolean values

Q: How can i get scalacheck to test all combinations of 3 boolean values. There should be 8 distinct lines of printouts

``````property("booleanAndMonoid should obey associativeLaw") {
def associativeLaw[A](x:A, y:A, z:A)(implicit m:Monoid[A]):Boolean = m.combine(x, m.combine(y,z)) == m.combine(m.combine(x,y), z)
forAll { (b1:Boolean, b2:Boolean, b3:Boolean) =>
println(s"\$b1 \$b2 \$b3")
associativeLaw[Boolean](b1, b2, b3) should be (true)
}
}
``````

I figured this is probably not a good use case for scalacheck since you can define on your own the complete combinations of 3 boolean values

``````class MonoidSpec extends FlatSpec with Matchers {
private def associativeLaw[A](x:A, y:A, z:A)(implicit m:Monoid[A]):Boolean = m.combine(x, m.combine(y,z)) == m.combine(m.combine(x,y), z)
private val combinations = for {
x <- Seq(true,false)
y <- Seq(true,false)
z <- Seq(true,false)
} yield (x,y,z)
"booleanAndMonoid" should "obey associativeLaw" in {
assert(combinations.forall{
tuple => associativeLaw[Boolean](tuple._1, tuple._2, tuple._3)
})
}
}
``````