/faker-cs

C# port of the Ruby Faker gem (http://faker.rubyforge.org/)

Primary LanguageC#MIT LicenseMIT

Faker

NuGet Build status

Codebase is built with AppVeyor and manually deployed to the offical nuGet feed from there.

C# port of the Ruby Faker gem (http://faker.rubyforge.org/) and is used to easily generate fake data:

addresses (UK, US),
boolean,
companies,
countries,
currencies,
enums,
finance (isin, ticker, coupon, maturity, bond name),
identification (social security number (US), MBI (US), national insurance number (UK), passport number (UK & US))
internet (email, domain names, user names),
lorem ipsum,
names,
phone numbers

Available as a NuGet package (https://nuget.org/packages/Faker.Net).

Get the code via git:

git clone git://github.com/slashdotdash/faker-cs.git

Example code

var name = Faker.Name.FullName(); // Tod Yundt
var firstName = Faker.Name.First(); // Orlando
var lastName = Faker.Name.Last(); // Brekke
var address = Faker.Address.StreetAddress(); // 713 Pfeffer Bridge
var city = Faker.Address.City(); // Reynaton
var number = Faker.RandomNumber.Next(100); // 30
var ssn = Faker.Identification.SocialSecurityNumber(); // 249-17-9666
var mbi = Faker.Identification.MedicareBeneficiaryIdentifier(); // 8NK0Q74KT53
var nin = Faker.Identification.UkNationalInsuranceNumber(); // YA171053Y
var dob = Faker.Identification.DateOfBirth(); // 1971-11-16T00:00:00.0000000Z
var ukPassport = Faker.Identification.UkPassport(); // 496675685
var usPassport = Faker.Identification.UsPassport(); // 335587506

Supported versions:

.NET framework 4.0,
.NET framework 4.5,
.NET framework 4.6,
.NET framework 4.7,
.NET framework 4.8,
.NET Standard 2.0,
.NET Standard 2.1,
.NET Core 3.0,
.NET Core 3.1

No longer supported in nuGet package (1.1 going forward):

.NET framework 3.5 SP1,
Silverlight 3.0,
Silverlight 4.0,
Silverlight 5.0,
Windows Phone 7,
Windows Phone 7.1