BT

InfoQ Homepage News Use Faker.NET To Fake Your Data

Use Faker.NET To Fake Your Data

Bookmarks

Faker is an open source C# port of the Ruby Faker gem mainly used to easily generate fake (but presentable) data – names, addresses, phone numbers, etc. Handy, whether its for demonstration purposes or for creating test data.

How does it work? A look inside the code shows how – the solution contains resource files with possible good values for each of the attributes (for eg. First Name, Last Name, etc) and code randomly mixes and matches these to generate the data. The more the pre-fed values for each of these attributes, the more combinations are possible and hence richer the data. Depending on your specific needs, you might want to modify the resource files to reflect the data you need (for instance, names or addresses localized to a particular region). An article from Ollie Riches shows a quick usage of the library.

The utility is compatible with .NET Framework 4.0, Silverlight 3-5 and Windows Phone 7.0 and 7.1. It is available as a NuGet Package.

There is another GitHub project with the same name (Faker.NET) that seems to work in the same way except for a couple of things – the possible values are directly in the C# code (instead of resource files) and it has an additional class for Education (Degree, Major, School, etc).

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • wow

    by cowboy cowboy /

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.