WithName
Utility for creating dummy data for tests.
- Value parameters:
- creator
The code that should be called to generate a new value of your dummy object depending on the choosen name
- Example:
``` scala import com.alejandrohdezma.dummy.Dummy import java.util.UUID import scala.util.Random object dummy { val dogs = Dummy.withName(name => s"$name-${UUID.randomUUID()}") val cats = Dummy.withName(name => s"${Random.alphanumeric.take(5).mkString}-$name") } ``` And then use it in your tests with any value you want: ``` dummy.dogs.snoopy dummy.dogs.`santa's-little-helper` dummy.cats.garfield dummy.cats.sylvester ```
trait Serializable
trait Product
trait Equals
trait Dynamic
class Object
trait Matchable
class Any