Created
December 21, 2012 19:41
-
-
Save mgonto/4355240 to your computer and use it in GitHub Desktop.
FactoryPal multiple template register
This file contains 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
//Default template creation | |
FactoryPal.register[Person]() { person => | |
person.name.mapsTo("gonto") and | |
person.age.isRandom | |
} | |
//Creating template for a certain name. This way you can create multiple templates for a certain class | |
FactoryPal.register[Person](Some('coolPerson)) { person => | |
person.name.mapsTo("cool") and | |
person.age.isRandom | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment