RimuTec.Faker 0.12.0

A library to generate fake data e.g. for authoring tests, for preparing software demos or for creating screenshots. It includes generators for fake data such as Lorem text, names for persons and company, phone numbers, job titles, etc. This libary is a C# port of the Ruby Faker gem https://github.com/stympy/faker and targets netstandard2.0 and net462.

There is a newer version of this package available.
See the version list below for details.
Install-Package RimuTec.Faker -Version 0.12.0
dotnet add package RimuTec.Faker --version 0.12.0
<PackageReference Include="RimuTec.Faker" Version="0.12.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RimuTec.Faker --version 0.12.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Faker

A C# port of the Ruby Faker gem https://github.com/stympy/faker. It uses the latest version of their yaml files.

RimuTec.Faker targets .NET Standard 2.0 (netstandard2.0) and .NET Framework 4.6.2 (net462).

| Metric | Status |
| ----- | ----- |
| Nuget | NuGet Badge |

Available Fake Data Generators

Because Ruby Faker has a large number of generators, we had to start with a small set of classes. Our aim is to add the remaining classes and method over time. If you have preferences please file suggestions as issues on Github (see below). Thank you!

Address

  • BuildingNumber()
  • Community()
  • SecondaryAddress()
  • StreetAddress(bool includeSecondary = false)
  • StreetName()
  • ZipCode(string stateAbbreviation = "")

Company

This class is on par with Ruby Faker.

Basic methods:

  • Bs()
  • Buzzword()
  • CatchPhrase()
  • DunsNumber()
  • Ein()
  • Industry()
  • Logo()
  • Name()
  • Profession()
  • Suffix()
  • Type()

Country specific methods:

  • AustralianBusinessNumber()
  • CzechOrganizationNumber()
  • FrenchSirenNumber()
  • FrenchSiretNumber()
  • NorwegianOrganizationNumber()
  • PolishRegisterOfNationalEconomy(int length = 9)
  • PolishTaxpayerIdentificationNumber()
  • SpanishOrganizationNumber()
  • SwedishOrganizationNumber()

Job

  • EmploymentType()
  • EducationLevel()
  • Field()
  • KeySkill()
  • Position()
  • Seniority()
  • Title()

Lorem

This class is on par with Ruby Faker.

  • Character()
  • Characters(int charCount = 255)
  • Multibyte()
  • Paragraph(int sentenceCount = 3, bool supplemental = false, int randomSentencesToAdd = 0)
  • ParagraphByChars(int chars = 256, bool supplemental = false)
  • Paragraphs(int paragraphCount = 3, bool supplemental = false)
  • Question(int wordCount = 4, bool supplemental = false, int randomWordsToAdd = 0)
  • Questions(int questionCount = 3, bool supplemental = false)
  • Sentence(int wordCount = 4, bool supplemental = false, int randomWordsToAdd = 0)
  • Sentences(int sentenceCount = 3, bool supplemental = false)
  • Word()
  • Words(int wordCount = 3, bool supplemental = false)

Name

This class is on par with Ruby Faker.

  • FirstName()
  • FullName() (equivalent to Ruby's Faker::Name.name)
  • Initials(int characterCount)
  • LastName()
  • MiddleName()
  • NameWithMiddle()
  • Prefix()
  • Suffix()

PhoneNumber

  • CellPhone()
  • LandLine(): Equivalent to Ruby Faker::PhoneNumber.phone_number

RandomNumber

  • Next()
  • Next(int maxValue)
  • Next(int minValue, int maxValue)
  • ResetSeed(int seed)

Usage

Installation

This library is available as NuGet package at https://www.nuget.org/packages/RimuTec.Faker

The source code and the library are available under a MIT license. This means you can use this libary and/or the source for free in your own projects, including closed-source and commercial projects. Terms and conditions are as per the MIT license in this project.

Generating Fake Data

  1. Install NuGet package. See https://www.nuget.org/packages/RimuTec.Faker for instructions
  2. Add using RimuTec.Faker; at the beginning of your C# source file (or the equivalent for your preferred .NET language)
  3. Generate fake data, e.g. var firstName = Name.NameWithMiddle();

In case of name clashes with other classes in your code base, use one of the following techniques in C# source files:

  1. use fully qualify names, e.g. var firstName = RimuTec.Faker.Name.NameWithMiddle();. Use this if there are only a couple of occurances.
  2. add using NameFaker = RimuTec.Faker.Name; at the beginning of the file and then var firstName = NameFaker.NameWithMiddle();. Use this option if you have many usages within the source file.

Release Notes

Release notes are available at https://github.com/RimuTec/Faker/blob/master/releasenotes.md

Reporting Issues

Although RimuTec.Faker has about 130 unit tests, that is no proof of absence of bugs. To help making this library more valuable for other users please report bugs at https://github.com/RimuTec/Faker/issues ideally including steps to reproduce. We also consider pull requests (PR). Thank you!

Support & Suggestions

If you have a support question please file an issue at https://github.com/RimuTec/Faker/issues. Thank you!

If you have a suggestion for improvement please file an issue as well. Thank you!

Credits

This project uses the yaml files from the Ruby Faker gem under a MIT license. Thank you to all their contributors!

Faker

A C# port of the Ruby Faker gem https://github.com/stympy/faker. It uses the latest version of their yaml files.

RimuTec.Faker targets .NET Standard 2.0 (netstandard2.0) and .NET Framework 4.6.2 (net462).

| Metric | Status |
| ----- | ----- |
| Nuget | NuGet Badge |

Available Fake Data Generators

Because Ruby Faker has a large number of generators, we had to start with a small set of classes. Our aim is to add the remaining classes and method over time. If you have preferences please file suggestions as issues on Github (see below). Thank you!

Address

  • BuildingNumber()
  • Community()
  • SecondaryAddress()
  • StreetAddress(bool includeSecondary = false)
  • StreetName()
  • ZipCode(string stateAbbreviation = "")

Company

This class is on par with Ruby Faker.

Basic methods:

  • Bs()
  • Buzzword()
  • CatchPhrase()
  • DunsNumber()
  • Ein()
  • Industry()
  • Logo()
  • Name()
  • Profession()
  • Suffix()
  • Type()

Country specific methods:

  • AustralianBusinessNumber()
  • CzechOrganizationNumber()
  • FrenchSirenNumber()
  • FrenchSiretNumber()
  • NorwegianOrganizationNumber()
  • PolishRegisterOfNationalEconomy(int length = 9)
  • PolishTaxpayerIdentificationNumber()
  • SpanishOrganizationNumber()
  • SwedishOrganizationNumber()

Job

  • EmploymentType()
  • EducationLevel()
  • Field()
  • KeySkill()
  • Position()
  • Seniority()
  • Title()

Lorem

This class is on par with Ruby Faker.

  • Character()
  • Characters(int charCount = 255)
  • Multibyte()
  • Paragraph(int sentenceCount = 3, bool supplemental = false, int randomSentencesToAdd = 0)
  • ParagraphByChars(int chars = 256, bool supplemental = false)
  • Paragraphs(int paragraphCount = 3, bool supplemental = false)
  • Question(int wordCount = 4, bool supplemental = false, int randomWordsToAdd = 0)
  • Questions(int questionCount = 3, bool supplemental = false)
  • Sentence(int wordCount = 4, bool supplemental = false, int randomWordsToAdd = 0)
  • Sentences(int sentenceCount = 3, bool supplemental = false)
  • Word()
  • Words(int wordCount = 3, bool supplemental = false)

Name

This class is on par with Ruby Faker.

  • FirstName()
  • FullName() (equivalent to Ruby's Faker::Name.name)
  • Initials(int characterCount)
  • LastName()
  • MiddleName()
  • NameWithMiddle()
  • Prefix()
  • Suffix()

PhoneNumber

  • CellPhone()
  • LandLine(): Equivalent to Ruby Faker::PhoneNumber.phone_number

RandomNumber

  • Next()
  • Next(int maxValue)
  • Next(int minValue, int maxValue)
  • ResetSeed(int seed)

Usage

Installation

This library is available as NuGet package at https://www.nuget.org/packages/RimuTec.Faker

The source code and the library are available under a MIT license. This means you can use this libary and/or the source for free in your own projects, including closed-source and commercial projects. Terms and conditions are as per the MIT license in this project.

Generating Fake Data

  1. Install NuGet package. See https://www.nuget.org/packages/RimuTec.Faker for instructions
  2. Add using RimuTec.Faker; at the beginning of your C# source file (or the equivalent for your preferred .NET language)
  3. Generate fake data, e.g. var firstName = Name.NameWithMiddle();

In case of name clashes with other classes in your code base, use one of the following techniques in C# source files:

  1. use fully qualify names, e.g. var firstName = RimuTec.Faker.Name.NameWithMiddle();. Use this if there are only a couple of occurances.
  2. add using NameFaker = RimuTec.Faker.Name; at the beginning of the file and then var firstName = NameFaker.NameWithMiddle();. Use this option if you have many usages within the source file.

Release Notes

Release notes are available at https://github.com/RimuTec/Faker/blob/master/releasenotes.md

Reporting Issues

Although RimuTec.Faker has about 130 unit tests, that is no proof of absence of bugs. To help making this library more valuable for other users please report bugs at https://github.com/RimuTec/Faker/issues ideally including steps to reproduce. We also consider pull requests (PR). Thank you!

Support & Suggestions

If you have a support question please file an issue at https://github.com/RimuTec/Faker/issues. Thank you!

If you have a suggestion for improvement please file an issue as well. Thank you!

Credits

This project uses the yaml files from the Ruby Faker gem under a MIT license. Thank you to all their contributors!

Release Notes

Relase notes listing new features and other changes are available at https://github.com/RimuTec/Faker/blob/master/releasenotes.md

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.40.0 271 8/5/2018
0.39.0 188 7/29/2018
0.38.0 176 7/27/2018
0.37.0 180 7/26/2018
0.36.0 175 7/25/2018
0.35.0 168 7/24/2018
0.34.0 185 7/23/2018
0.33.0 189 7/22/2018
0.32.0 198 7/17/2018
0.31.0 216 7/17/2018
0.30.0 193 7/15/2018
0.29.0 218 7/14/2018
0.28.0 221 7/13/2018
0.27.0 198 7/12/2018
0.26.0 212 7/11/2018
0.25.0 218 7/10/2018
0.24.0 219 7/9/2018
0.23.0 220 7/8/2018
0.22.0 178 7/7/2018
0.21.0 201 7/6/2018
0.20.0 219 7/5/2018
0.19.0 216 7/4/2018
0.18.0 229 7/4/2018
0.17.0 207 7/2/2018
0.16.0 231 7/1/2018
0.15.0 233 6/30/2018
0.14.0 187 6/29/2018
0.13.0 184 6/28/2018
0.12.0 227 6/27/2018
0.11.0 232 6/26/2018
0.10.0 206 6/25/2018
0.9.0 239 6/24/2018
0.8.0 220 6/23/2018
0.7.0 220 6/22/2018
0.6.0 279 6/21/2018
0.5.0 230 6/20/2018
0.4.0 221 6/20/2018
0.3.0 225 6/19/2018
0.2.0 220 6/19/2018
0.1.0 207 6/18/2018
Show less