[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Use Faker.NET To Fake Your Data

Use Faker.NET To Fake Your Data

This item in japanese

Apr 03, 2012 1 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

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

This content is in the .NET topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /