six2six / fixture-factory

Generator fake objects from a template
Apache License 2.0
445 stars 88 forks source link

Casting by type target property #3

Closed aparra closed 11 years ago

aparra commented 12 years ago

Example:

public class Any { private Long id; }

Fixture.of(Any.class).addTemplate("valid", new Rule(){{ add("id", regex("\d{3,5}")); });

The regex function yields a value not compatible with id.