GithubHelp home page GithubHelp logo

faker-cs's Introduction

Faker

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

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

Supported version:

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

Usage

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

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

Names, phone numbers and emails

var name = Faker.Name.FullName();  // "Alene Hayes"
Faker.Internet.Email(name);  // "[email protected]"
Faker.Internet.UserName(name);  // "alene.hayes"

Faker.Internet.Email();  // "[email protected]"
Faker.Internet.FreeEmail();  // "[email protected]"

Faker.Internet.DomainName();  // "larkinhirthe.com"

Faker.Phone.Number();  // "(033)216-0058 x0344"

Addresses

Faker.Address.StreetAddress();  // "52613 Turcotte Lock"
Faker.Address.SecondaryAddress();  // "Suite 656"
Faker.Address.City();  // "South Wavaside"

Faker.Address.UkCounty();  // "West Glamorgan"
Faker.Address.UkPostCode().ToUpper();  // "BQ7 3AM"

Faker.Address.UsState();  // "Tennessee"
Faker.Address.ZipCode();  // "66363-7828"

Lorem Ipsum sentences and paragraphs

Faker.Lorem.Sentence();  // "Voluptatem repudiandae necessitatibus assumenda dolor illo maiores in."
Faker.Lorem.Paragraph();  /* "Rerum dolor cumque cum animi consequatur praesentium. Enim quia quia modi est ut. Dolores qui debitis qui perspiciatis autem quas. Expedita distinctio earum aut. Delectus assumenda rerum quibusdam harum iusto." */

Buzzword bingo

Last, but not least, you can generate company names, catchphrases and bs!

Faker.Company.Name();  // "Dickens Group"
Faker.Company.CatchPhrase();  // "User-centric neutral internet solution"
Faker.Company.BS();  // "transition proactive solution"

faker-cs's People

Contributors

alexeveritt avatar chanibal avatar danatkinson avatar diegodfsd avatar draptik avatar loren-brown avatar majorsilence avatar oriches avatar philip-schroeder-shsviveon avatar samwa avatar scottmcginness avatar slashdotdash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

faker-cs's Issues

Bug in german countries

when using Faker.Address.Country() on an german enviroment, , nearly all countries will be returned:

Äquatorialguinea Äthiopien Österreich Afghanistan Albanien Algerien Amerikanisch-Samoa Amerikanische Jungferninseln Andorra Angola Anguilla Antarktis Antigua und Barbuda Argentinien Armenien Aruba Aserbaidschan Australien Bahamas Bahrain Bangladesch Barbados Belarus Belgien Belize Benin die Bermudas Bhutan Bolivien Bosnien und Herzegowina Botsuana Bouvetinsel Brasilien Britische Jungferninseln Britisches Territorium im Indischen Ozean [...]

The reason is, that in File https://github.com/slashdotdash/faker-cs/blob/master/src/Faker/Resources/Address.de-DE.resx#L130 the seperator between the Countries are missing.

I can provide an pull-request with an corrected ressources, if desired.

Kind regards from germany,
Philip

Dotnet framework 2?

When I build or restore a project I get something like:

: warning NU1701: Package 'Faker.Net 1.0.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.

Any possibility to update this package to 2.0?

Thank you.

Kevin

Extending Package

Currently, is there any way to add additional Faker data/methods? For example, can I do something like:

using System;
using System.Collections.Generic;
using Faker.Extensions;

namespace Faker
{
    public static class PartNumber
    {
        public static string Full()
        {
            return ArrayExtensions.Random(Faker.Resources.PartNumber).Trim();
        }
    }
}

To add functionality to the existing implementation (installed via NuGet)

Nuget package?

I'm interested in using Faker and was wondering you would interested if I created a nuget package?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.