Skip to content

jsauvexamarin/Faker.NET.Portable

 
 

Repository files navigation

Faker.NET Portable Edition

Join the chat at https://gitter.im/AdmiringWorm/Faker.NET.Portable

AppVeyor Travis NuGet GitHub Codecov
AppVeyor Travis NuGet GitHub release codecov.io

C# port of the Ruby Faker gem (http://faker.rubyforge.org/) and is used to easily generate fake data: names, addresses, phone numbers, etc. This project is based on the faker-cs project so all credit goes to it's owner.

Availabe as a NuGet package here.

Get the code via git:

git clone https://github.com/AdmiringWorm/Faker.NET.Portable.git

Supported version:

.NET framework 4.0,
Silverlight 5.0,
Windows 8,
Windows Phone 8.1,
Windows Phone Silverlight 8,
Xamarin.Android,
Xamarin.iOS,
Xamarin.iOS (Classic),
Mono 3.2.8

Usage

Add a reference to Faker.Portable.dll in you project within Visual Studio.

Start using the Faker methods to generate your random test data.

Addresses

Faker.Address.BuildingNumber();         // "65337
Faker.Address.City();                   // "East Omafurt"
Faker.Address.CityPrefix();             // "Port"
Faker.Address.CitySuffix();             // "furt"
Faker.Address.Country();                // "Vietnam"
Faker.Address.CountryCode();            // "MG"
Faker.Address.DefaultCountry();         // "United States"
Faker.Address.Latitude();               // 84.308
Faker.Address.Longitude();              // 11.797
Faker.Address.SecondaryAddress();       // "Apt. 409
Faker.Address.State();                  // "New Mexico"
Faker.Address.StateAbbreviation();      // "AL"
Faker.Address.StreetAddress();          // "17297 Gerry Ports"
Faker.Address.StreetAddress(
       bool includeSecondaryAddress);   // "4345 Eloy Skyway Apt. 349"
Faker.Address.StreetName();             // "Lockman Parkways"
Faker.Address.StreetSuffix();           // "Lodge"
Faker.Address.TimeZone();               // "America/La_Paz"
Faker.Address.ZipCode();                // "14309"

App

Faker.App.Author();                     // "Hartmann LLC"
Faker.App.Name();                       // "Flixflex"
Faker.App.Version();                    // "0.8.6"

Avatar

Faker.Avatar.Image(
        string slug,
        string size,
        ImageFormat format,
        string set)             // "http://robohash.org/dictasitsit.png?size=300x300&set=set1"

Business

Faker.Business.CreditCardNumber();      // "1211-1221-1234-2201"
Faker.Business.CreditCardExpiryDate();  // "visa"
Faker.Business.CreditCardType();        // 2019-07-17 15:35:35.731

Company

Faker.Company.Bullshit();               // "syndicate innovative architectures"
Faker.Company.CatchPhrase();            // "Fundamental stable workforce"
Faker.Company.Logo();                   // "http://pigment.github.io/fake-logos/logos/medium/color/13.png"
Faker.Company.Name();                   // "Parisian-Witting"
Faker.Company.Suffix();                 // "and Sons"

Internet

Faker.Internet.DomainName();            // "roberts.us"
Faker.Internet.DomainSuffix();          // "info"
Faker.Internet.DomainWord();            // "mrazmedhurst"
Faker.Internet.Email();                 // "felicia_reinger@brownstroman.info"
Faker.Internet.FreeEmail();             // "adela_murphy@yahoo.com"
Faker.Internet.IPv4Address();           // "107.40.61.129"
Faker.Internet.IPv6Address();           // "5a84:cd5:5e97:b368:6266:30fe:f0e5:5eff"
Faker.Internet.MacAddress(
        string prefix,
        char groupSplit);               // "A8:D9:1B:F2:D5:A2"
Faker.Internet.Password(
        int minLength,
        int maxLength);                 // "2e@0SEu'!&ao:+("
Faker.Internet.Slug(
        string words,
        string glue);                   // "inventore_excepturi"
Faker.Internet.Url();                   // "http://www2.dibbert.net/ernesto"
Faker.Internet.UserName();              // "eino_olson"

Lorem Ipsum

Faker.Lorem.Characters(int charCount);  // "PIXQAe"
Faker.Lorem.Paragraph();                // "Necessitatibus est soluta est modi. Ut debitis iste provident est eum voluptas ut. Unde aliquid quo excepturi omnis hic fuga consectetur dolores. Provident neque beatae omnis illo eos."
Faker.Lorem.Sentence();                 // "Consectetur beatae et doloremque amet."

Names

Faker.Name.First();                     // "Kaylie"
Faker.Name.FullName();                  // "Ms. Sallie Murphy III"
Faker.Name.Last();                      // "Braun"
Faker.Name.Prefix();                    // "Ms."
Faker.Name.Suffix();                    // "Jr."

Phone numbers

Faker.Phone.CellNumber();               // "(581) 147-4247"
Faker.Phone.Extension();                // "3485"
Faker.Phone.Number();                   // "1-331-588-8777 x15811"
Faker.Phone.SubscriberNumber();         // "2424"

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%