FakeData – Realistic Data Generation

FakeData originated as a Library Add-On for FakeModel, designed to offer realistic data sources for population of data. After some consideration, I decided to separate the two into separate NuGet Packages. This is because both complete different functions, and can be used standalone without need for the other.

FakeData is a .Net Library which offers the generation of realistic data for whatever purpose it is required. This could be data for Unit Tests, for the Development Environment or to be used in Client Demo’s.

It is quick, and incredibly easy to use.

Install FakeData

FakeData can be installed using the NuGet package manager, or by following this link.

Using FakeData


            ArrayData.GetElement("One", "Two", "Three"); //Returns an element from the array
            ArrayData.GetElement(2, "One", "Two", "Three"); //Returns two elements from the array, may be duplicates

            BooleanData.GetBoolean(); //Returns Boolean

            CollectionData.GetElement(new List<string>() { "Item", "Item" }); //Returns an element from the ICollection object
            CollectionData.GetElement(7, new List<string>() { "Item", "Item" }); //Returns 7 elements from the ICollection object, may be duplicates

            DateTimeData.GetDatetime(); //Returns a DateTime
            DateTimeData.GetDatetime(new DateTime(1973, 1, 1), new DateTime(1973, 12, 1)); //Returns a DateTime between 01/01/1973 and 01/12/1973

            EnumData.GetElement<MyEnum>(); //Returns an element from MyEnum

            NameData.GetFirstName(); //Returns male or female first name
            NameData.GetFemaleFirstName(); //Returns female first name
            NameData.GetMaleFirstName(); //Returns male first name
            NameData.GetSurname(); // Returns surname
            NameData.GetFullName(); //Returns firstname + surname
            NameData.GetCompanyName(); //Returns the name of a company, I.E -> Riddick and Sons

            NetworkData.GetDomain(); //Returns a domain name
            NetworkData.GetDomain("CompanyName"); //Returns a domain based on CompanyName
            NetworkData.GetEmail(); //Returns a valid email address
            NetworkData.GetEmail("MyDomain.com"); //Returns a valid email address @MyDomain.com
            NetworkData.GetEmail("Adam", "Riddick"); //Returns valid email address based on name
            NetworkData.GetIpAddress(); //Returns a valid IP Address (IPv4)
            NetworkData.GetMacAddress(); //Returns a valid MAC Address

            PhoneNumberData.GetInternationalPhoneNumber(); //Returns an International Dial Phone Number
            PhoneNumberData.GetPhoneNumber(); //Returns a valid UK Phone Number
            PhoneNumberData.GetUsPhoneNumber(); //Returns a valid US Phone Number

            PlaceData.GetAddress(); //Returns a House Number and Street Name
            PlaceData.GetCity(); //Returns a valid city name
            PlaceData.GetCountry(); //Returns a valid country
            PlaceData.GetCounty(); //Returns a valid UK County
            PlaceData.GetPostCode(); //Returns a valid UK Postal Code
            PlaceData.GetState(); //Returns a valid US State
            PlaceData.GetStreetName(); //Returns a valid street name
            PlaceData.GetStreetNumber(); //Returns a house number
            PlaceData.GetZipCode(); //Returns a US Zip Code

            TextData.GetAlphabetical(10); //Returns a random Alphabetical string with 10 characters
            TextData.GetAlphaNumeric(10); //Returns a random AlphaNumeric string with 10 characters
            TextData.GetNumeric(10); //Returns a random Numeric string with 10 characters
            TextData.GetPatternString("##-??"); //Returns a string where # is replace by a numer and ? is replaced by a letter
            TextData.GetSentence(); //Returns a random Lorem Ipsum sentence
            TextData.GetSentences(5); //Returns 5 random Lorem Ipsum sentences
            TextData.GetSubString(5, "This is my string"); //Returns 5 random characters from "This is my string"

Planned Enhancements

Currently, I have no enhancements planned as FakeData contains enough functionality to fulfil it’s original purpose.

If you have any suggestions, feel free to get in touch.

Version History

Version 1.0.0 -> Initial Release