Closed
Description
Put an implicit operator for type on Faker so that I can do this:
public Faker<Thing> NormalThing = new Faker<Thing>
.RuleFor(t => t.Name, f => f.Name.FirstName);
public Faker<Thing> HackerThing = DefaultThing
.RuleFor(t => t.Handle, f => f.Hacker.Verb);
Thing normalThing = HackerThing;
Without the implicit operator, I either have to Generate in the consumer all the time, or copy various rules around the codebase. All the implicit operator would do is call Generate() - ShouldWork (tm).
If I get some time over the next week or so I'll try and code this up and send over a PR. Check this articule from Kenneth Truyers for more of an insight.
Metadata
Metadata
Assignees
Labels
No labels