14
Feb
2012
NuGet Project Uncovered: FakeO
If you are coming to this series of posts for the first time you might check out my introductory post for a little context.
FakeO is a fake object generation library. It doesn?t seem to play nicely with objects that require parameters in the constructor. However if you have lots of classes that have a default constructor and plain old get/set properties this project might be very useful.
You can even specify not just random text or numbers to generate, but some specific context driven data.
For example:
- Random company name
- Lorem Ipsum to various lengths.
- Phone numbers
- Random strings based on a regex.
- etc?
// example FakeO call var comp = FakeO.Create.Fake<Company>( c => c.Name = FakeO.Company.Name(), c => c.Phone = FakeO.Phone.Number(), c => c.EmployeeCount = FakeO.Number.Next(100,200)); // random number from 100 to 200
I’m wondering if this is like Moq for entity/property bag objects.
I’ve written a test data generator that is available as a nuget package (
http://nuget.org/packages/TestDataGenerator ) also sources on github here (
https://github.com/etishor/TestDataGenerator )