jeffh / Fox

Property Based Testing Library for Objective-C and Swift. QuickCheck for Apple's Platforms.
http://fox-testing.rtfd.org
Other
624 stars 30 forks source link

DSL.swift: Use random seed by default #16

Closed modocache closed 9 years ago

modocache commented 9 years ago

Providing a default value for the seed parameter allows consumers to leave it out altogether, i.e.:

Assert(forAll(FOXInteger(), { integer in
  let weight = integer as Int
  let banana = Banana(weight: weight)
  let peeled = peel(banana)
  return peeled.weight == banana.weight
})) // <- No need to specify `seed: nil` as 2nd param to `Assert` here.