├── .gitignore ├── .idea └── .idea.Faker │ └── .idea │ ├── .gitignore │ ├── .name │ ├── encodings.xml │ ├── indexLayout.xml │ ├── riderModule.iml │ └── vcs.xml ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── Faker.Net.nuspec ├── Faker.sln ├── Faker.sln.DotSettings ├── Faker.v3.ncrunchsolution ├── LICENSE ├── README.markdown ├── UpgradeLog.htm ├── packages └── NUnit.3.13.2 │ ├── .signature.p7s │ ├── CHANGES.md │ ├── LICENSE.txt │ ├── NOTICES.txt │ ├── NUnit.3.13.2.nupkg │ ├── build │ └── NUnit.props │ ├── icon.png │ └── lib │ ├── net35 │ ├── nunit.framework.dll │ └── nunit.framework.xml │ ├── net40 │ ├── nunit.framework.dll │ └── nunit.framework.xml │ ├── net45 │ ├── nunit.framework.dll │ └── nunit.framework.xml │ └── netstandard2.0 │ ├── nunit.framework.dll │ └── nunit.framework.xml ├── src ├── Faker.Net.4.5 │ └── Faker.Net.4.5.csproj ├── Faker.Net.4.6 │ └── Faker.Net.4.6.csproj ├── Faker.Net.4.7 │ └── Faker.Net.4.7.csproj ├── Faker.Net.4.8 │ └── Faker.Net.4.8.csproj ├── Faker.Net.5.0 │ └── Faker.Net.5.0.csproj ├── Faker.Net.6.0 │ └── Faker.Net.6.0.csproj ├── Faker.Net.Core.3.0 │ └── Faker.Net.Core.3.0.csproj ├── Faker.Net.Core.3.1 │ ├── AssemblyInfo.cs │ ├── Faker - Backup.Net.Core.3.1.csproj │ └── Faker.Net.Core.3.1.csproj ├── Faker.Net.Standard.2.0 │ └── Faker.Net.Standard.2.0.csproj ├── Faker.Net.Standard.2.1 │ └── Faker.Net.Standard.2.1.csproj └── Faker │ ├── Address.cs │ ├── Boolean.cs │ ├── Company.cs │ ├── Config.cs │ ├── Country.cs │ ├── Currency.cs │ ├── Enum.cs │ ├── Extensions │ ├── ArrayExtensions.cs │ ├── EnumerableExtensions.cs │ └── StringExtensions.cs │ ├── Faker.csproj │ ├── Finance.cs │ ├── Helpers │ └── UkHelper.cs │ ├── Identification.cs │ ├── Internet.cs │ ├── Lorem.cs │ ├── Name.cs │ ├── Phone.cs │ ├── Properties │ ├── AssemblyInfo.cs │ └── SharedAssemblyInfo.cs │ ├── RandomNumber.cs │ └── Resources │ ├── Address.Designer.cs │ ├── Address.de-DE.resx │ ├── Address.resx │ ├── Company.Designer.cs │ ├── Company.de-DE.resx │ ├── Company.resx │ ├── Country.Designer.cs │ ├── Country.de-DE.resx │ ├── Country.resx │ ├── Currency.Designer.cs │ ├── Currency.de-DE.resx │ ├── Currency.resx │ ├── Identification.Designer.cs │ ├── Identification.de-DE.resx │ ├── Identification.resx │ ├── Internet.Designer.cs │ ├── Internet.de-DE.resx │ ├── Internet.resx │ ├── Lorem.Designer.cs │ ├── Lorem.de-DE.resx │ ├── Lorem.resx │ ├── Name.Designer.cs │ ├── Name.de-DE.resx │ ├── Name.resx │ ├── Phone.Designer.cs │ ├── Phone.de-DE.resx │ └── Phone.resx └── tests ├── Faker.Tests.Net.4.8 ├── Faker.Tests.Net.4.8.csproj ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── Faker.Tests.Net.5.0 └── Faker.Tests.Net.5.0.csproj ├── Faker.Tests.Net.6.0 └── Faker.Tests.Net.6.0.csproj ├── Faker.Tests.Net.6.02 └── Faker.Tests.Net.6.02.csproj ├── Faker.Tests.Net.Standard.2.1 └── Faker.Tests.Net.Standard.2.1.csproj └── Faker.Tests ├── AddressFixture.cs ├── CompanyFixture.cs ├── CountryFixture.cs ├── CultureInfoFixture.cs ├── CurrencyFixture.cs ├── Extensions ├── ArrayExtensionsFixture.cs ├── EnumerableExtensionsFixture.cs └── StringExtensionsFixture.cs ├── Faker.Tests.csproj ├── FinanceFixture.cs ├── Helpers └── UkHelperFixture.cs ├── IdentificationFixture.cs ├── InternetFixture.cs ├── LoremFixture.cs ├── NameFixture.cs ├── PhoneFixture.cs ├── Properties └── AssemblyInfo.cs ├── RandomNumberFixture.cs └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | *.user 4 | *.suo 5 | _ReSharper.* 6 | *.sln.cache 7 | _UpgradeReport_Files* 8 | UpgradeLog.XML 9 | .vs 10 | _NCrunch_Faker/ 11 | -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /.idea.Faker.iml 6 | /modules.xml 7 | /contentModel.xml 8 | /projectSettingsUpdater.xml 9 | # Datasource local storage ignored files 10 | /../../../../../../../:\Work\GitHub\faker-cs\.idea\.idea.Faker\.idea/dataSources/ 11 | /dataSources.local.xml 12 | # Editor-based HTTP Client requests 13 | /httpRequests/ 14 | -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/.name: -------------------------------------------------------------------------------- 1 | Faker -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/riderModule.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/.idea.Faker/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/.nuget/NuGet.exe -------------------------------------------------------------------------------- /.nuget/NuGet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\..\ 5 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) 6 | $(NuGetToolsPath)\nuget.exe 7 | $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) 8 | $([System.IO.Path]::Combine($(SolutionDir), "packages")) 9 | $(TargetDir.Trim('\\')) 10 | 11 | 12 | "" 13 | 14 | 15 | false 16 | 17 | 18 | false 19 | 20 | 21 | "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" 22 | "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols 23 | 24 | 25 | 26 | RestorePackages; 27 | $(BuildDependsOn); 28 | 29 | 30 | 31 | 32 | $(BuildDependsOn); 33 | BuildPackage; 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | 49 | 51 | 52 | -------------------------------------------------------------------------------- /Faker.Net.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Faker.Net 5 | 1.0 6 | Ben Smith,Ollie Riches,Robin Michael 7 | Ben Smith,Ollie Riches,Robin Michael 8 | false 9 | https://github.com/oriches/faker-cs 10 | C# port of the Ruby Faker gem (http://faker.rubyforge.org/) and is used to easily generate fake data: names, addresses, phone numbers, etc. 11 | C# port of the Ruby Faker gem (http://faker.rubyforge.org/) 12 | Ben Smith, Ollie Riches, Robin Michael 2022 13 | Faker, Testing, TDD, .Net, .Net Standard, .Net Core 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Faker.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | False -------------------------------------------------------------------------------- /Faker.v3.ncrunchsolution: -------------------------------------------------------------------------------- 1 |  2 | 3 | True 4 | True 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Ben Smith, Ollie Riches 2018, Robin Michael 2020 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Faker 2 | 3 | [![NuGet](https://img.shields.io/nuget/v/faker.net.svg)](https://www.nuget.org/packages/faker.net) 4 | [![Build status](https://ci.appveyor.com/api/projects/status/uy628dn0tfl0triy?svg=true)](https://ci.appveyor.com/project/oriches/faker-cs) 5 | [![FuGet](https://www.fuget.org/packages/Faker.Net/badge.svg)](https://www.fuget.org/packages/Faker.Net/badge.svg) 6 | 7 | Codebase is built with AppVeyor and manually deployed to the offical nuGet feed from there. 8 | 9 | C# port of the Ruby Faker gem (http://faker.rubyforge.org/) and is used to easily generate fake data: 10 | 11 | addresses (UK, US), 12 | boolean, 13 | companies, 14 | countries, 15 | currencies, 16 | enums, 17 | finance (isin, ticker, coupon, maturity, bond name), 18 | identification (social security number (US), MBI (US), national insurance number (UK), passport number (UK & US), Bulgarian Person Identification Number(PIN/ENG)) 19 | internet (email, domain names, user names), 20 | lorem ipsum, 21 | names, 22 | phone numbers 23 | 24 | Available as a NuGet package (https://nuget.org/packages/Faker.Net). 25 | 26 | Get the code via git: 27 | 28 | git clone git://github.com/slashdotdash/faker-cs.git 29 | 30 | Example code 31 | ```CSharp 32 | var name = Faker.Name.FullName(); // Tod Yundt 33 | var firstName = Faker.Name.First(); // Orlando 34 | var lastName = Faker.Name.Last(); // Brekke 35 | var address = Faker.Address.StreetAddress(); // 713 Pfeffer Bridge 36 | var city = Faker.Address.City(); // Reynaton 37 | var number = Faker.RandomNumber.Next(100); // 30 38 | var dob = Faker.Identification.DateOfBirth(); // 1971-11-16T00:00:00.0000000Z 39 | 40 | // US - United States 41 | var ssn = Faker.Identification.SocialSecurityNumber(); // 249-17-9666 42 | var mbi = Faker.Identification.MedicareBeneficiaryIdentifier(); // 8NK0Q74KT53 43 | var usPassport = Faker.Identification.UsPassportNumber(); // 335587506 44 | 45 | // UK - United Kingdom 46 | var nin = Faker.Identification.UkNationalInsuranceNumber(); // YA171053Y 47 | var ninFormatted = Faker.Identification.UkNationalInsuranceNumber(true); // YA 17 10 53 Y 48 | var ukPassport = Faker.Identification.UkPassportNumber(); // 496675685 49 | var ukNhs = Faker.Identification.UkNhsNumber(); // 6584168301 50 | var ukNhsFormatted = Faker.Identification.UkNhsNumber(true); // 658 416 8301 51 | 52 | // BG - Bulgaria 53 | var bulgarianPin = Faker.Identification.BulgarianPin(); //6402142606 54 | ``` 55 | 56 | Supported versions: 57 | 58 | .NET framework 4.5, 59 | .NET framework 4.6, 60 | .NET framework 4.7, 61 | .NET framework 4.8, 62 | .NET Standard 2.0, 63 | .NET Standard 2.1, 64 | .NET Core 3.0, 65 | .NET Core 3.1, 66 | .NET 5.0, 67 | .NET 6.0 68 | 69 | No longer supported in nuGet package (1.1 going forward): 70 | 71 | .NET framework 3.5 SP1, 72 | .NET framework 4.0, 73 | Silverlight 3.0, 74 | Silverlight 4.0, 75 | Silverlight 5.0, 76 | Windows Phone 7, 77 | Windows Phone 7.1 78 | -------------------------------------------------------------------------------- /UpgradeLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/UpgradeLog.htm -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/.signature.p7s -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Charlie Poole, Rob Prouse 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/NOTICES.txt: -------------------------------------------------------------------------------- 1 | NUnit 3.0 is based on earlier versions of NUnit, with Portions 2 | 3 | Copyright (c) 2002-2014 Charlie Poole or 4 | Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or 5 | Copyright (c) 2000-2002 Philip A. Craig 6 | -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/NUnit.3.13.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/NUnit.3.13.2.nupkg -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/build/NUnit.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/icon.png -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/lib/net35/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/lib/net35/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/lib/net40/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/lib/net40/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/lib/net45/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/lib/net45/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.3.13.2/lib/netstandard2.0/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oriches/faker-cs/a0c73368b1f9d94a7f6185987078daf271f3303c/packages/NUnit.3.13.2/lib/netstandard2.0/nunit.framework.dll -------------------------------------------------------------------------------- /src/Faker.Net.5.0/Faker.Net.5.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Faker 6 | 1.0.0 7 | 1.0.0.0 8 | 1.0.0.0 9 | https://github.com/oriches/faker-cs 10 | false 11 | 8.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/Faker.Net.6.0/Faker.Net.6.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | Faker 6 | enable 7 | 1.0.0 8 | 1.0.0.0 9 | 1.0.0.0 10 | https://github.com/oriches/faker-cs 11 | false 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/Faker.Net.Core.3.0/Faker.Net.Core.3.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.0 5 | Faker.Net 6 | Faker 7 | Faker.Net.Core.3.0 8 | 1.0.0 9 | 1.0.0.0 10 | 1.0.0.0 11 | https://github.com/oriches/faker-cs 12 | false 13 | 8.0 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/Faker.Net.Core.3.1/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Faker.Tests.Net.Core.3.1")] -------------------------------------------------------------------------------- /src/Faker.Net.Core.3.1/Faker - Backup.Net.Core.3.1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | Faker 6 | Faker 7 | 1.0.0 8 | 1.0.0.0 9 | 1.0.0.0 10 | https://github.com/oriches/faker-cs 11 | false 12 | 8.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | ResXFileCodeGenerator 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/Faker.Net.Core.3.1/Faker.Net.Core.3.1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | Faker 6 | Faker 7 | 1.0.0 8 | 1.0.0.0 9 | 1.0.0.0 10 | https://github.com/oriches/faker-cs 11 | false 12 | 8.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/Faker.Net.Standard.2.0/Faker.Net.Standard.2.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Faker 6 | 1.0.0 7 | 1.0.0.0 8 | 1.0.0.0 9 | https://github.com/oriches/faker-cs 10 | false 11 | 8.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/Faker.Net.Standard.2.1/Faker.Net.Standard.2.1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | Faker 6 | 1.0.0 7 | 1.0.0.0 8 | 1.0.0.0 9 | https://github.com/oriches/faker-cs 10 | false 11 | 8.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/Faker/Address.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Faker.Extensions; 4 | 5 | namespace Faker 6 | { 7 | public static class Address 8 | { 9 | private static readonly IEnumerable> CityFormats = new List> 10 | { 11 | () => $"{CityPrefix()} {Name.First()}{CitySuffix()}", 12 | () => $"{CityPrefix()} {Name.First()}", 13 | () => $"{Name.First()}{CitySuffix()}", 14 | () => $"{Name.Last()}{CitySuffix()}" 15 | }; 16 | 17 | private static readonly IEnumerable> StreetFormats = new List> 18 | { 19 | () => new[] {Name.Last(), StreetSuffix()}, 20 | () => new[] {Name.First(), StreetSuffix()} 21 | }; 22 | 23 | private static readonly IEnumerable> StreetAddressFormats = new List> 24 | { 25 | () => string.Format(Resources.Address.AddressFormat.Split(Config.Separator) 26 | .Random() 27 | .Trim(), StreetName()) 28 | }; 29 | 30 | public static string Country() 31 | { 32 | return Resources.Address.Country.Split(Config.Separator) 33 | .Random() 34 | .Trim(); 35 | } 36 | 37 | public static string ZipCode() 38 | { 39 | return Resources.Address.ZipCode.Split(Config.Separator) 40 | .Random() 41 | .Trim() 42 | .Numerify(); 43 | } 44 | 45 | public static string UsMilitaryState() 46 | { 47 | return Resources.Address.UsMilitaryState.Split(Config.Separator) 48 | .Random() 49 | .Trim(); 50 | } 51 | 52 | public static string UsMilitaryStateAbbr() 53 | { 54 | return Resources.Address.UsMilitaryStateAbbr.Split(Config.Separator) 55 | .Random(); 56 | } 57 | 58 | public static string UsTerritory() 59 | { 60 | return Resources.Address.UsTerritory.Split(Config.Separator) 61 | .Random() 62 | .Trim(); 63 | } 64 | 65 | public static string UsTerritoryStateAbbr() 66 | { 67 | return Resources.Address.UsTerritoryAbbr.Split(Config.Separator) 68 | .Random(); 69 | } 70 | 71 | public static string UsState() 72 | { 73 | return Resources.Address.UsState.Split(Config.Separator) 74 | .Random() 75 | .Trim(); 76 | } 77 | 78 | public static string UsStateAbbr() 79 | { 80 | return Resources.Address.UsStateAbbr.Split(Config.Separator) 81 | .Random(); 82 | } 83 | 84 | public static string CityPrefix() 85 | { 86 | return Resources.Address.CityPrefix.Split(Config.Separator) 87 | .Random(); 88 | } 89 | 90 | public static string CitySuffix() 91 | { 92 | return Resources.Address.CitySuffix.Split(Config.Separator) 93 | .Random(); 94 | } 95 | 96 | public static string City() 97 | { 98 | return CityFormats.Random(); 99 | } 100 | 101 | public static string StreetSuffix() 102 | { 103 | return Resources.Address.StreetSuffix.Split(Config.Separator) 104 | .Random(); 105 | } 106 | 107 | public static string StreetName() 108 | { 109 | var result = string.Join(Resources.Address.StreetNameSeparator, StreetFormats.Random()); 110 | return result; 111 | } 112 | 113 | public static string StreetAddress(bool includeSecondary = false) 114 | { 115 | return StreetAddressFormats.Random() 116 | .Numerify() + (includeSecondary ? " " + SecondaryAddress() : ""); 117 | } 118 | 119 | public static string SecondaryAddress() 120 | { 121 | return Resources.Address.SecondaryAddress.Split(Config.Separator) 122 | .Random() 123 | .Trim() 124 | .Numerify(); 125 | } 126 | 127 | public static string UkCounty() 128 | { 129 | return Resources.Address.UkCounties.Split(Config.Separator) 130 | .Random() 131 | .Trim(); 132 | } 133 | 134 | public static string UkCountry() 135 | { 136 | return Resources.Address.UkCountry.Split(Config.Separator) 137 | .Random() 138 | .Trim(); 139 | } 140 | 141 | public static string UkPostCode() 142 | { 143 | return Resources.Address.UkPostCode.Split(Config.Separator) 144 | .Random() 145 | .Trim() 146 | .Numerify() 147 | .Letterify(); 148 | } 149 | 150 | public static string CaProvince() 151 | { 152 | return Resources.Address.CaProvince.Split(Config.Separator) 153 | .Random() 154 | .Trim(); 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /src/Faker/Boolean.cs: -------------------------------------------------------------------------------- 1 | namespace Faker 2 | { 3 | public static class Boolean 4 | { 5 | public static bool Random() 6 | { 7 | var index = RandomNumber.Next(0, 2); 8 | return index != 0; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Faker/Company.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Faker.Extensions; 4 | 5 | namespace Faker 6 | { 7 | public static class Company 8 | { 9 | private static readonly IEnumerable> NameFormats = new List> 10 | { 11 | () => $"{Faker.Name.Last()} {Suffix()}", 12 | () => $"{Faker.Name.Last()}-{Faker.Name.Last()}", 13 | () => $"{Faker.Name.Last()}, {Faker.Name.Last()} {Resources.Company.And} {Faker.Name.Last()}" 14 | }; 15 | 16 | public static string Name() 17 | { 18 | return NameFormats.Random(); 19 | } 20 | 21 | public static string Suffix() 22 | { 23 | return Resources.Company.Suffix.Split(Config.Separator) 24 | .Random(); 25 | } 26 | 27 | /// 28 | /// Generate a buzzword-laden catch phrase. 29 | /// Wordlist from http://www.1728.com/buzzword.htm 30 | /// 31 | public static string CatchPhrase() 32 | { 33 | return string.Join(" ", Resources.Company.Buzzwords1.Split(Config.Separator) 34 | .Random(), 35 | Resources.Company.Buzzwords2.Split(Config.Separator) 36 | .Random(), 37 | Resources.Company.Buzzwords3.Split(Config.Separator) 38 | .Random()); 39 | } 40 | 41 | /// 42 | /// When a straight answer won't do, BS to the rescue! 43 | /// Wordlist from http://dack.com/web/bullshit.html 44 | /// 45 | public static string BS() 46 | { 47 | return string.Join(" ", Resources.Company.BS1.Split(Config.Separator) 48 | .Random(), 49 | Resources.Company.BS2.Split(Config.Separator) 50 | .Random(), 51 | Resources.Company.BS3.Split(Config.Separator) 52 | .Random()); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /src/Faker/Config.cs: -------------------------------------------------------------------------------- 1 | namespace Faker 2 | { 3 | public static class Config 4 | { 5 | public static char Separator { get; set; } = ';'; 6 | } 7 | } -------------------------------------------------------------------------------- /src/Faker/Country.cs: -------------------------------------------------------------------------------- 1 | using Faker.Extensions; 2 | 3 | namespace Faker 4 | { 5 | public static class Country 6 | { 7 | public static string TwoLetterCode() 8 | { 9 | return Resources.Country.Iso2LetterCodes.Split(Config.Separator) 10 | .Random(); 11 | } 12 | 13 | public static string Name() 14 | { 15 | return Resources.Country.Names.Split(Config.Separator) 16 | .Random(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Faker/Currency.cs: -------------------------------------------------------------------------------- 1 | using Faker.Extensions; 2 | 3 | namespace Faker 4 | { 5 | public static class Currency 6 | { 7 | public static string ThreeLetterCode() 8 | { 9 | return Resources.Currency.Iso3LetterCodes.Split(Config.Separator) 10 | .Random(); 11 | } 12 | 13 | public static string Name() 14 | { 15 | return Resources.Currency.Names.Split(Config.Separator) 16 | .Random(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Faker/Enum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Faker 4 | { 5 | public static class Enum 6 | { 7 | public static T Random() where T : System.Enum 8 | { 9 | var type = typeof(T); 10 | if (!type.IsEnum) 11 | throw new ArgumentException("The given type is not an enum"); 12 | 13 | var values = System.Enum.GetValues(type); 14 | if (values.Length == 0) 15 | throw new ArgumentException("The given enum doesn't have any values"); 16 | 17 | var index = RandomNumber.Next(0, values.Length - 1); 18 | 19 | var rawValue = values.GetValue(index); 20 | if (rawValue is T value) 21 | { 22 | return value; 23 | } 24 | 25 | throw new Exception("Failed Random Enum"); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/ArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | // ReSharper disable CheckNamespace 6 | 7 | namespace Faker.Extensions 8 | { 9 | public static class ArrayExtensions 10 | { 11 | /// 12 | /// Select a random element from the array. 13 | /// 14 | public static string Random(this string[] list) 15 | { 16 | if (list.Length == 0) throw new InvalidOperationException("Array must contain at least one item"); 17 | 18 | return list[RandomNumber.Next(0, list.Length - 1)]; 19 | } 20 | 21 | /// 22 | /// Select a random string from the Enumerable list. 23 | /// 24 | public static string Random(this IEnumerable> list) 25 | { 26 | if (!list.Any()) throw new InvalidOperationException("Enumerable list must contain at least one item"); 27 | 28 | return list.ElementAt(RandomNumber.Next(0, list.Count() - 1)) 29 | .Invoke(); 30 | } 31 | 32 | /// 33 | /// Select a random string array from the Enumerable list. 34 | /// 35 | public static string[] Random(this IEnumerable> list) 36 | { 37 | if (!list.Any()) throw new InvalidOperationException("Enumerable list must contain at least one item"); 38 | 39 | return list.ElementAt(RandomNumber.Next(0, list.Count() - 1)) 40 | .Invoke(); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | // ReSharper disable CheckNamespace 5 | 6 | namespace Faker.Extensions 7 | { 8 | public static class EnumerableExtensions 9 | { 10 | public static IEnumerable Times(this int count, Func func) 11 | { 12 | for (var i = 0; i < count; i++) 13 | yield return func.Invoke(i); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | // ReSharper disable CheckNamespace 4 | 5 | namespace Faker.Extensions 6 | { 7 | public static class StringExtensions 8 | { 9 | private static readonly string[] Alphabet = "a b c d e f g h i j k l m n o p q r s t u v w x y z".Split(' '); 10 | 11 | /// 12 | /// Get a string with every occurence of '#' replaced with a random number. 13 | /// 14 | public static string Numerify(this string s) 15 | { 16 | return Regex.Replace(s, "#", m => RandomNumber.Next(0, 9) 17 | .ToString(), RegexOptions.Compiled); 18 | } 19 | 20 | /// 21 | /// Get a string with every '?' replaced with a random character from the alphabet. 22 | /// 23 | public static string Letterify(this string s) 24 | { 25 | return Regex.Replace(s, @"\?", m => Alphabet.Random(), RegexOptions.Compiled); 26 | } 27 | 28 | public static string AlphanumericOnly(this string s) 29 | { 30 | return Regex.Replace(s, @"\W", ""); 31 | } 32 | 33 | /// 34 | /// Capitalise the first letter of the given string. 35 | /// 36 | /// 37 | /// 38 | public static string Capitalise(this string s) 39 | { 40 | return Regex.Replace(s, "^[a-z]", x => x.Value.ToUpperInvariant()); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Faker/Finance.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Threading; 6 | 7 | namespace Faker 8 | { 9 | public static class Finance 10 | { 11 | private const string SecurityCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 12 | private const string TickerCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 13 | private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); 14 | 15 | public static string Isin() 16 | { 17 | var securityIdentifier = $"{Country.TwoLetterCode()}{SecurityIdentifier()}"; 18 | var checkSum = CalculateChecksum(securityIdentifier); 19 | 20 | return $"{securityIdentifier}{checkSum}"; 21 | } 22 | 23 | public static string Ticker() 24 | { 25 | var length = RandomNumber.Next(2, 4); 26 | 27 | return new string(Enumerable.Repeat(TickerCharacters, length) 28 | .Select(s => s[RandomNumber.Next(s.Length - 1)]) 29 | .ToArray()); 30 | } 31 | 32 | public static DateTime Maturity(int minimumMaturityInMonths = 6, int maximumMaturityInMonths = 180) 33 | { 34 | var months = RandomNumber.Next(minimumMaturityInMonths, maximumMaturityInMonths); 35 | var days = RandomNumber.Next(1, 28); 36 | var date = DateTime.Now.Date.AddMonths(months) 37 | .AddDays(days); 38 | 39 | return date; 40 | } 41 | 42 | public static decimal Coupon() 43 | { 44 | var minor = RandomNumber.Next(0, 1000); 45 | var major = RandomNumber.Next(0, 12) * 1000; 46 | 47 | return decimal.Round(Convert.ToDecimal(major + minor) / 1000, 3); 48 | } 49 | 50 | private static string SecurityIdentifier() 51 | { 52 | return new string(Enumerable.Repeat(SecurityCharacters, 9) 53 | .Select(s => s[RandomNumber.Next(s.Length - 1)]) 54 | .ToArray()); 55 | } 56 | 57 | private static int CalculateChecksum(IEnumerable codeWithoutChecksum, bool reverseLuhn = false, 58 | bool allowSymbols = false) 59 | { 60 | return reverseLuhn 61 | ? codeWithoutChecksum 62 | .Select((c, i) => c.OrdinalPosition(allowSymbols) 63 | .ConditionalMultiplyByTwo(i.IsOdd()) 64 | .SumDigits()) 65 | .Sum() 66 | .TensComplement() 67 | : codeWithoutChecksum 68 | .ToArray() 69 | .ToDigits(allowSymbols) 70 | .Select((d, i) => d.ConditionalMultiplyByTwo(i.IsEven()) 71 | .SumDigits()) 72 | .Sum() 73 | .TensComplement(); 74 | } 75 | 76 | private static int OrdinalPosition(this char c, bool allowSymbols = false) 77 | { 78 | if (char.IsLower(c)) 79 | return char.ToUpper(c) - 'A' + 10; 80 | 81 | if (char.IsUpper(c)) 82 | return c - 'A' + 10; 83 | 84 | if (char.IsDigit(c)) 85 | return c.ToInt(); 86 | 87 | if (allowSymbols) 88 | switch (c) 89 | { 90 | case '*': 91 | return 36; 92 | case '@': 93 | return 37; 94 | case '#': 95 | return 38; 96 | } 97 | 98 | throw new ArgumentOutOfRangeException(nameof(c), 99 | @"Specified character is not a letter, digit or allowed symbol."); 100 | } 101 | 102 | private static bool IsEven(this int x) 103 | { 104 | return x % 2 == 0; 105 | } 106 | 107 | private static bool IsOdd(this int x) 108 | { 109 | return !IsEven(x); 110 | } 111 | 112 | private static int ToInt(this char digit) 113 | { 114 | if (char.IsDigit(digit)) 115 | return digit - '0'; 116 | throw new ArgumentOutOfRangeException(nameof(digit), @"Specified character is not a digit."); 117 | } 118 | 119 | private static IEnumerable ToDigits(this char[] s, bool allowSymbols = false) 120 | { 121 | var digits = new List(); 122 | for (var i = s.Length - 1; i >= 0; i--) 123 | { 124 | var ordinalPosition = s[i] 125 | .OrdinalPosition(allowSymbols); 126 | digits.Add(ordinalPosition % 10); 127 | if (ordinalPosition > 9) 128 | digits.Add(ordinalPosition / 10); 129 | } 130 | 131 | return digits; 132 | } 133 | 134 | private static int SumDigits(this int value) 135 | { 136 | return value / 10 + value % 10; 137 | } 138 | 139 | private static int ConditionalMultiplyByTwo(this int value, bool condition) 140 | { 141 | return condition ? value * 2 : value; 142 | } 143 | 144 | private static int TensComplement(this int value) 145 | { 146 | return (10 - value % 10) % 10; 147 | } 148 | 149 | public static class Credit 150 | { 151 | public static string BondName() 152 | { 153 | return BondClass() 154 | .ToString(); 155 | } 156 | 157 | public static Bond BondClass() 158 | { 159 | var ticker = Ticker(); 160 | var coupon = Coupon(); 161 | var maturity = Maturity(); 162 | 163 | if (Equals(Thread.CurrentThread.CurrentCulture, UsCulture) || 164 | Equals(Thread.CurrentThread.CurrentUICulture, UsCulture)) 165 | return new Bond(ticker, coupon, maturity, "MM/dd/yy"); 166 | 167 | return new Bond(ticker, coupon, maturity, "dd/MM/yy"); 168 | } 169 | 170 | public struct Bond 171 | { 172 | private readonly string _toString; 173 | 174 | public string Ticker { get; } 175 | 176 | public decimal Coupon { get; } 177 | 178 | public DateTime Maturity { get; } 179 | 180 | internal Bond(string ticker, decimal coupon, DateTime maturity, string format) 181 | { 182 | Ticker = ticker; 183 | Coupon = coupon; 184 | Maturity = maturity; 185 | 186 | var maturityString = Maturity.ToString(format); 187 | _toString = $"{Ticker} {Coupon} {maturityString}"; 188 | } 189 | 190 | public override string ToString() 191 | { 192 | return _toString; 193 | } 194 | } 195 | } 196 | } 197 | } -------------------------------------------------------------------------------- /src/Faker/Helpers/UkHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Faker 4 | { 5 | public static class UkHelper 6 | { 7 | public static string CalculateNhsNumberChecksum(string nineDigitNumber) 8 | { 9 | if (string.IsNullOrWhiteSpace(nineDigitNumber) || nineDigitNumber.Length != 9) 10 | throw new Exception("Invalid partial NHS number!"); 11 | 12 | var result = 0; 13 | for (var i = 0; i < 9; i++) 14 | result += Convert.ToInt16(nineDigitNumber[i] 15 | .ToString()) * (11 - (i + 1)); 16 | 17 | result = 11 - result % 11; 18 | if (result == 11) 19 | result = 0; 20 | 21 | return result.ToString(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Faker/Internet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.RegularExpressions; 5 | using Faker.Extensions; 6 | 7 | namespace Faker 8 | { 9 | public static class Internet 10 | { 11 | private static readonly IEnumerable> UserNameFormats = new List> 12 | { 13 | () => Name.First() 14 | .AlphanumericOnly() 15 | .ToLowerInvariant(), 16 | () => $"{Name.First().AlphanumericOnly()}{new[] {".", "_"}.Random()}{Name.Last().AlphanumericOnly()}" 17 | .ToLowerInvariant() 18 | }; 19 | 20 | public static string Email() 21 | { 22 | return $"{UserName()}@{DomainName()}"; 23 | } 24 | 25 | public static string Email(string name) 26 | { 27 | return $"{UserName(name)}@{DomainName()}"; 28 | } 29 | 30 | public static string FreeEmail() 31 | { 32 | return $"{UserName()}@{Resources.Internet.FreeMail.Split(Config.Separator).Random()}"; 33 | } 34 | 35 | public static string UserName() 36 | { 37 | return UserNameFormats.Random(); 38 | } 39 | 40 | public static string UserName(string name) 41 | { 42 | return Regex.Replace(name, @"[^\w]+", x => new[] {".", "_"}.Random(), RegexOptions.Compiled) 43 | .ToLowerInvariant(); 44 | } 45 | 46 | public static string DomainName() 47 | { 48 | return $"{DomainWord()}.{DomainSuffix()}"; 49 | } 50 | 51 | public static string Url() 52 | { 53 | var subDomain = Resources.Internet.SubDomain.Split(Config.Separator) 54 | .Random(); 55 | var page = Resources.Internet.Page.Split(Config.Separator) 56 | .Random(); 57 | var pageSuffix = Resources.Internet.PageSuffix.Split(Config.Separator) 58 | .Random(); 59 | return $"http://www.{DomainName()}/{subDomain}/{page}.{pageSuffix}"; 60 | } 61 | 62 | public static string SecureUrl() 63 | { 64 | var subDomain = Resources.Internet.SubDomain.Split(Config.Separator) 65 | .Random(); 66 | var page = Resources.Internet.Page.Split(Config.Separator) 67 | .Random(); 68 | var pageSuffix = Resources.Internet.PageSuffix.Split(Config.Separator) 69 | .Random(); 70 | return $"https://www.{DomainName()}/{subDomain}/{page}.{pageSuffix}"; 71 | } 72 | 73 | public static string DomainWord() 74 | { 75 | return Company.Name() 76 | .Split(' ') 77 | .First() 78 | .AlphanumericOnly() 79 | .ToLowerInvariant(); 80 | } 81 | 82 | public static string DomainSuffix() 83 | { 84 | return Resources.Internet.DomainSuffix.Split(Config.Separator) 85 | .Random(); 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /src/Faker/Lorem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Faker.Extensions; 5 | 6 | namespace Faker 7 | { 8 | public static class Lorem 9 | { 10 | public static IEnumerable Words(int count) 11 | { 12 | if (count <= 0) throw new ArgumentException(@"Count must be greater than zero", nameof(count)); 13 | 14 | return count.Times(x => Resources.Lorem.Words.Split(Config.Separator) 15 | .Random()); 16 | } 17 | 18 | public static string GetFirstWord() 19 | { 20 | return Resources.Lorem.Words.Split(Config.Separator) 21 | .First(); 22 | } 23 | 24 | public static string Sentence(int minWordCount) 25 | { 26 | if (minWordCount <= 0) 27 | throw new ArgumentException(@"Count must be greater than zero", nameof(minWordCount)); 28 | 29 | return string.Join(" ", Words(minWordCount + RandomNumber.Next(6)) 30 | .ToArray()) 31 | .Capitalise() + "."; 32 | } 33 | 34 | public static string Sentence() 35 | { 36 | return Sentence(4); 37 | } 38 | 39 | public static IEnumerable Sentences(int sentenceCount) 40 | { 41 | if (sentenceCount <= 0) 42 | throw new ArgumentException(@"Count must be greater than zero", nameof(sentenceCount)); 43 | 44 | return sentenceCount.Times(x => Sentence()); 45 | } 46 | 47 | public static string Paragraph(int minSentenceCount) 48 | { 49 | if (minSentenceCount <= 0) 50 | throw new ArgumentException(@"Count must be greater than zero", nameof(minSentenceCount)); 51 | 52 | return string.Join(" ", Sentences(minSentenceCount + RandomNumber.Next(3)) 53 | .ToArray()); 54 | } 55 | 56 | public static string Paragraph() 57 | { 58 | return Paragraph(3); 59 | } 60 | 61 | public static IEnumerable Paragraphs(int paragraphCount) 62 | { 63 | if (paragraphCount <= 0) 64 | throw new ArgumentException(@"Count must be greater than zero", nameof(paragraphCount)); 65 | 66 | return paragraphCount.Times(x => Paragraph()); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /src/Faker/Name.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using Faker.Extensions; 6 | 7 | [assembly: InternalsVisibleTo("Faker.Tests.Net.5.0")] 8 | [assembly: InternalsVisibleTo("Faker.Tests.Net.Standard.2.1")] 9 | 10 | namespace Faker 11 | { 12 | public enum NameFormats 13 | { 14 | Standard, 15 | StandardWithMiddle, 16 | StandardWithMiddleWithPrefix, 17 | StandardWithMiddleWithPrefixWithSuffix, 18 | StandardWithMiddleWithSuffix, 19 | WithPrefix, 20 | WithSuffix, 21 | WithPrefixWithSuffix 22 | } 23 | 24 | public static class Name 25 | { 26 | private static readonly IEnumerable Formats = new List 27 | { 28 | NameFormats.WithPrefix, NameFormats.WithSuffix, NameFormats.Standard, NameFormats.Standard, 29 | NameFormats.WithPrefixWithSuffix, 30 | NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, 31 | NameFormats.Standard, NameFormats.StandardWithMiddleWithPrefix, 32 | NameFormats.StandardWithMiddleWithPrefixWithSuffix, NameFormats.StandardWithMiddleWithSuffix 33 | }; 34 | 35 | private static readonly IDictionary> FormatMap = 36 | new Dictionary> 37 | { 38 | {NameFormats.Standard, () => new[] {First(), Last()}}, 39 | {NameFormats.StandardWithMiddle, () => new[] {First(), Middle(), Last()}}, 40 | {NameFormats.StandardWithMiddleWithPrefix, () => new[] {Prefix(), First(), Middle(), Last()}}, 41 | {NameFormats.StandardWithMiddleWithSuffix, () => new[] {First(), Middle(), Last(), Suffix()}}, 42 | { 43 | NameFormats.StandardWithMiddleWithPrefixWithSuffix, 44 | () => new[] {Prefix(), First(), Middle(), Last(), Suffix()} 45 | }, 46 | {NameFormats.WithPrefix, () => new[] {Prefix(), First(), Last()}}, 47 | {NameFormats.WithSuffix, () => new[] {First(), Last(), Suffix()}}, 48 | {NameFormats.WithPrefixWithSuffix, () => new[] {Prefix(), First(), Last(), Suffix()}} 49 | }; 50 | 51 | /// 52 | /// Create a name using a random format. 53 | /// 54 | public static string FullName() 55 | { 56 | return FullName(Formats.ElementAt(RandomNumber.Next(Formats.Count() - 1))); 57 | } 58 | 59 | /// 60 | /// Create a name using a specified format. 61 | /// 62 | public static string FullName(NameFormats format) 63 | { 64 | return string.Join(" ", FormatMap[format] 65 | .Invoke()); 66 | } 67 | 68 | public static string First() 69 | { 70 | return Resources.Name.First.Split(Config.Separator) 71 | .Random() 72 | .Trim(); 73 | } 74 | 75 | public static string Middle() 76 | { 77 | return Resources.Name.First.Split(Config.Separator) 78 | .Random() 79 | .Trim(); 80 | } 81 | 82 | public static string Last() 83 | { 84 | return Resources.Name.Last.Split(Config.Separator) 85 | .Random() 86 | .Trim(); 87 | } 88 | 89 | public static string Prefix() 90 | { 91 | return Resources.Name.Prefix.Split(Config.Separator) 92 | .Random(); 93 | } 94 | 95 | public static string Suffix() 96 | { 97 | return Resources.Name.Suffix.Split(Config.Separator) 98 | .Random(); 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /src/Faker/Phone.cs: -------------------------------------------------------------------------------- 1 | using Faker.Extensions; 2 | 3 | namespace Faker 4 | { 5 | public static class Phone 6 | { 7 | public static string Number() 8 | { 9 | return Resources.Phone.Formats.Split(Config.Separator) 10 | .Random() 11 | .Trim() 12 | .Numerify(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Faker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Faker.Net")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Faker.Net")] 10 | [assembly: AssemblyCopyright("Copyright © 2022")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("6e293261-e726-44bd-bffe-f5c454764512")] 17 | 18 | [assembly: AssemblyVersion("1.0.0.0")] 19 | [assembly: AssemblyFileVersion("1.0.0.0")] 20 | [assembly: InternalsVisibleTo("Faker.Tests.Net.4.8")] 21 | [assembly: InternalsVisibleTo("Faker.Tests.Net.5.0")] 22 | [assembly: InternalsVisibleTo("Faker.Tests.Net.6.0")] -------------------------------------------------------------------------------- /src/Faker/Properties/SharedAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Faker.Tests.Net.4.8")] 4 | [assembly: InternalsVisibleTo("Faker.Tests.Net.5.0")] 5 | [assembly: InternalsVisibleTo("Faker.Tests.Net.6.0")] -------------------------------------------------------------------------------- /src/Faker/RandomNumber.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace Faker 5 | { 6 | // constrain our values to between our min and max 7 | // https://stackoverflow.com/a/3057867/86411 8 | // 9 | public static class RandomNumber 10 | { 11 | private static readonly RandomNumberGenerator Rnd = RandomNumberGenerator.Create(); 12 | 13 | private static int Next(this RandomNumberGenerator generator, int min, int max) 14 | { 15 | var bytes = new byte[sizeof(int)]; 16 | generator.GetNonZeroBytes(bytes); 17 | var val = BitConverter.ToUInt32(bytes, 0); 18 | var result = ((val - min) % (max - min + 1) + (max - min) + 1) % (max - min + 1) + min; 19 | return (int)result; 20 | } 21 | 22 | private static long Next(this RandomNumberGenerator generator, long min, long max) 23 | { 24 | var bytes = new byte[sizeof(long)]; 25 | generator.GetNonZeroBytes(bytes); 26 | var val = BitConverter.ToInt32(bytes, 0); 27 | var result = ((val - min) % (max - min + 1) + (max - min) + 1) % (max - min + 1) + min; 28 | return result; 29 | } 30 | 31 | public static int Next() 32 | { 33 | return Rnd.Next(0, int.MaxValue); 34 | } 35 | 36 | public static int Next(int max) 37 | { 38 | return Rnd.Next(0, max); 39 | } 40 | 41 | public static long Next(long max) 42 | { 43 | return Rnd.Next(0, max); 44 | } 45 | 46 | public static int Next(int min, int max) 47 | { 48 | return Rnd.Next(min, max); 49 | } 50 | 51 | public static long Next(long min, long max) 52 | { 53 | return Rnd.Next(min, max); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/Faker/Resources/Country.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Country { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Country() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Country", typeof(Country).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | internal static string Iso2LetterCodes { 64 | get { 65 | return ResourceManager.GetString("Iso2LetterCodes", resourceCulture); 66 | } 67 | } 68 | 69 | internal static string Names 70 | { 71 | get 72 | { 73 | return ResourceManager.GetString("Names", resourceCulture); 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Faker/Resources/Currency.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Currency { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Currency() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Currency", typeof(Currency).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | internal static string Iso3LetterCodes { 64 | get { 65 | return ResourceManager.GetString("Iso3LetterCodes", resourceCulture); 66 | } 67 | } 68 | 69 | internal static string Names 70 | { 71 | get 72 | { 73 | return ResourceManager.GetString("Names", resourceCulture); 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Faker/Resources/Identification.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Identification { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Identification() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Identification", typeof(Identification).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | internal static string Alphabet { 64 | get { return ResourceManager.GetString("Alphabet", resourceCulture); } 65 | } 66 | 67 | internal static string Numeric { 68 | get { return ResourceManager.GetString("Numeric", resourceCulture); } 69 | } 70 | 71 | internal static string MbiNumeric 72 | { 73 | get { return ResourceManager.GetString("MbiNumeric", resourceCulture); } 74 | } 75 | 76 | internal static string MbiAlphabet 77 | { 78 | get { return ResourceManager.GetString("MbiAlphabet", resourceCulture); } 79 | } 80 | 81 | internal static string Mbi 82 | { 83 | get { return ResourceManager.GetString("Mbi", resourceCulture); } 84 | } 85 | 86 | internal static string UkNationalInsuranceFirstDigit 87 | { 88 | get { return ResourceManager.GetString("UkNationalInsuranceFirstDigit", resourceCulture); } 89 | } 90 | 91 | internal static string UkNationalInsuranceSecondDigit 92 | { 93 | get { return ResourceManager.GetString("UkNationalInsuranceSecondDigit", resourceCulture); } 94 | } 95 | 96 | internal static string UkNationalInsuranceNotAllowedPrefix 97 | { 98 | get { return ResourceManager.GetString("UkNationalInsuranceNotAllowedPrefix", resourceCulture); } 99 | } 100 | 101 | internal static string UkNationalInsuranceSuffix 102 | { 103 | get { return ResourceManager.GetString("UkNationalInsuranceSuffix", resourceCulture); } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/Faker/Resources/Identification.de-DE.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | ACDEFGHJKMNPQRTUVWXY 122 | 123 | 124 | A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Z;Y 125 | 126 | 127 | 1;2;3;4;5;6;7;8;9;A;C;D;E;F;G;H;J;K;M;N;P;Q;R;T;U;V;W;X;Y 128 | 129 | 130 | A;C;D;E;F;G;H;J;K;M;N;P;Q;R;T;U;V;W;X;Y 131 | 132 | 133 | 1;2;3;4;5;6;7;8;9 134 | 135 | 136 | 0;1;2;3;4;5;6;7;8;9 137 | 138 | 139 | A;B;C;E;G;H;J;K;L;M;N;O;P;R;S;T;W;X;Z;Y 140 | 141 | 142 | BG;GB;NK;KN;TN;NT;ZZ 143 | 144 | 145 | A;B;C;E;G;H;J;K;L;M;N;P;R;S;T;W;X;Z;Y 146 | 147 | 148 | A;B;C;D;F;M;P 149 | 150 | -------------------------------------------------------------------------------- /src/Faker/Resources/Identification.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | ACDEFGHJKMNPQRTUVWXY 122 | 123 | 124 | A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Z;Y 125 | 126 | 127 | 1;2;3;4;5;6;7;8;9;A;C;D;E;F;G;H;J;K;M;N;P;Q;R;T;U;V;W;X;Y 128 | 129 | 130 | A;C;D;E;F;G;H;J;K;M;N;P;Q;R;T;U;V;W;X;Y 131 | 132 | 133 | 1;2;3;4;5;6;7;8;9 134 | 135 | 136 | 0;1;2;3;4;5;6;7;8;9 137 | 138 | 139 | A;B;C;E;G;H;J;K;L;M;N;O;P;R;S;T;W;X;Z;Y 140 | 141 | 142 | BG;GB;NK;KN;TN;NT;ZZ 143 | 144 | 145 | A;B;C;E;G;H;J;K;L;M;N;P;R;S;T;W;X;Z;Y 146 | 147 | 148 | A;B;C;D 149 | 150 | -------------------------------------------------------------------------------- /src/Faker/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Internet { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Internet() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Internet", typeof(Internet).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to co.uk;com;us;uk;ca;biz;info;name. 65 | /// 66 | internal static string DomainSuffix { 67 | get { 68 | return ResourceManager.GetString("DomainSuffix", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to gmail.com;yahoo.com;hotmail.com. 74 | /// 75 | internal static string FreeMail { 76 | get { 77 | return ResourceManager.GetString("FreeMail", resourceCulture); 78 | } 79 | } 80 | 81 | internal static string Page 82 | { 83 | get 84 | { 85 | return ResourceManager.GetString("Page", resourceCulture); 86 | } 87 | } 88 | 89 | internal static string PageSuffix 90 | { 91 | get 92 | { 93 | return ResourceManager.GetString("PageSuffix", resourceCulture); 94 | } 95 | } 96 | 97 | internal static string SubDomain 98 | { 99 | get 100 | { 101 | return ResourceManager.GetString("SubDomain", resourceCulture); 102 | } 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Faker/Resources/Internet.de-DE.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | com;info;name;net;org;de;ch 122 | 123 | 124 | gmail.com;yahoo.com;hotmail.com 125 | 126 | 127 | index;page;root;resource;form;applet;template 128 | 129 | 130 | html;htm;asp;aspx;gem;lsp;jsp;res;rsx 131 | 132 | 133 | home;interviews;articles;facts;shop;catalog;reviews;shop/books;shop/food;shop/films;films;guide 134 | 135 | -------------------------------------------------------------------------------- /src/Faker/Resources/Internet.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | co.uk;com;us;uk;ca;biz;info;name 122 | 123 | 124 | gmail.com;yahoo.com;hotmail.com 125 | 126 | 127 | index;page;root;resource;form;applet;template 128 | 129 | 130 | html;htm;asp;aspx;gem;lsp;jsp;res;rsx 131 | 132 | 133 | home;interviews;articles;facts;shop;catalog;reviews;shop/books;shop/food;shop/films;films;guide 134 | 135 | -------------------------------------------------------------------------------- /src/Faker/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Lorem { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Lorem() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Lorem", typeof(Lorem).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to alias;consequatur;aut;perferendis;sit;voluptatem;accusantium;doloremque;aperiam;eaque;ipsa;quae;ab;illo;inventore;veritatis;et;quasi;architecto;beatae;vitae;dicta;sunt;explicabo;aspernatur;aut;odit;aut;fugit;sed;quia;consequuntur;magni;dolores;eos;qui;ratione;voluptatem;sequi;nesciunt;neque;dolorem;ipsum;quia;dolor;sit;amet;consectetur;adipisci;velit;sed;quia;non;numquam;eius;modi;tempora;incidunt;ut;labore;et;dolore;magnam;aliquam;quaerat;voluptatem;ut;enim;ad;minima;veniam;quis;nostrum;exercitationem;ulla [rest of string was truncated]";. 65 | /// 66 | internal static string Words { 67 | get { 68 | return ResourceManager.GetString("Words", resourceCulture); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Faker/Resources/Lorem.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | alias;consequatur;aut;perferendis;sit;voluptatem;accusantium;doloremque;aperiam;eaque;ipsa;quae;ab;illo;inventore;veritatis;et;quasi;architecto;beatae;vitae;dicta;sunt;explicabo;aspernatur;aut;odit;aut;fugit;sed;quia;consequuntur;magni;dolores;eos;qui;ratione;voluptatem;sequi;nesciunt;neque;dolorem;ipsum;quia;dolor;sit;amet;consectetur;adipisci;velit;sed;quia;non;numquam;eius;modi;tempora;incidunt;ut;labore;et;dolore;magnam;aliquam;quaerat;voluptatem;ut;enim;ad;minima;veniam;quis;nostrum;exercitationem;ullam;corporis;nemo;enim;ipsam;voluptatem;quia;voluptas;sit;suscipit;laboriosam;nisi;ut;aliquid;ex;ea;commodi;consequatur;quis;autem;vel;eum;iure;reprehenderit;qui;in;ea;voluptate;velit;esse;quam;nihil;molestiae;et;iusto;odio;dignissimos;ducimus;qui;blanditiis;praesentium;laudantium;totam;rem;voluptatum;deleniti;atque;corrupti;quos;dolores;et;quas;molestias;excepturi;sint;occaecati;cupiditate;non;provident;sed;ut;perspiciatis;unde;omnis;iste;natus;error;similique;sunt;in;culpa;qui;officia;deserunt;mollitia;animi;id;est;laborum;et;dolorum;fuga;et;harum;quidem;rerum;facilis;est;et;expedita;distinctio;nam;libero;tempore;cum;soluta;nobis;est;eligendi;optio;cumque;nihil;impedit;quo;porro;quisquam;est;qui;minus;id;quod;maxime;placeat;facere;possimus;omnis;voluptas;assumenda;est;omnis;dolor;repellendus;temporibus;autem;quibusdam;et;aut;consequatur;vel;illum;qui;dolorem;eum;fugiat;quo;voluptas;nulla;pariatur;at;vero;eos;et;accusamus;officiis;debitis;aut;rerum;necessitatibus;saepe;eveniet;ut;et;voluptates;repudiandae;sint;et;molestiae;non;recusandae;itaque;earum;rerum;hic;tenetur;a;sapiente;delectus;ut;aut;reiciendis;voluptatibus;maiores;doloribus;asperiores;repellat 122 | 123 | -------------------------------------------------------------------------------- /src/Faker/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Name { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Name() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Name", typeof(Name).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to Aaliyah; Aaron; Abagail; Abbey; Abbie; Abbigail; Abby; Abdiel; Abdul; Abdullah; Abe; Abel; Abelardo; Abigail; Abigale; Abigayle; Abner; Abraham; Ada; Adah; Adalberto; Adaline; Adam; Adan; Addie; Addison; Adela; Adelbert; Adele; Adelia; Adeline; Adell; Adella; Adelle; Aditya; Adolf; Adolfo; Adolph; Adolphus; Adonis; Adrain; Adrian; Adriana; Adrianna; Adriel; Adrien; Adrienne; Afton; Aglae; Agnes; Agustin; Agustina; Ahmad; Ahmed; Aida; Aidan; Aiden; Aileen; Aimee; Aisha; Aiyana; Akeem; Al; Alaina; Alan; Alana [rest of string was truncated]";. 65 | /// 66 | internal static string First { 67 | get { 68 | return ResourceManager.GetString("First", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to Abbott; Abernathy; Abshire; Adams; Altenwerth; Anderson; Ankunding; Armstrong; Auer; Aufderhar; Bahringer; Bailey; Balistreri; Barrows; Bartell; Bartoletti; Barton; Bashirian; Batz; Bauch; Baumbach; Bayer; Beahan; Beatty; Bechtelar; Becker; Bednar; Beer; Beier; Berge; Bergnaum; Bergstrom; Bernhard; Bernier; Bins; Blanda; Blick; Block; Bode; Boehm; Bogan; Bogisich; Borer; Bosco; Botsford; Boyer; Boyle; Bradtke; Brakus; Braun; Breitenberg; Brekke; Brown; Bruen; Buckridge; Carroll; Carter; Cartwright; Casper; [rest of string was truncated]";. 74 | /// 75 | internal static string Last { 76 | get { 77 | return ResourceManager.GetString("Last", resourceCulture); 78 | } 79 | } 80 | 81 | /// 82 | /// Looks up a localized string similar to Mr.;Mrs.;Ms.;Miss;Dr.. 83 | /// 84 | internal static string Prefix { 85 | get { 86 | return ResourceManager.GetString("Prefix", resourceCulture); 87 | } 88 | } 89 | 90 | /// 91 | /// Looks up a localized string similar to Jr.;Sr.;I;II;III;IV;V;MD;DDS;PhD;DVM. 92 | /// 93 | internal static string Suffix { 94 | get { 95 | return ResourceManager.GetString("Suffix", resourceCulture); 96 | } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/Faker/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Faker.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Phone { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Phone() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Faker.Resources.Phone", typeof(Phone).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to ###-###-####;(###)###-####;1-###-###-####;###.###.####;###-###-####;(###)###-####;1-###-###-####;###.###.####;###-###-#### x###;(###)###-#### x###;1-###-###-#### x###;###.###.#### x###;###-###-#### x####;(###)###-#### x####;1-###-###-#### x####;###.###.#### x####;###-###-#### x#####;(###)###-#### x#####;1-###-###-#### x#####;###.###.#### x#####. 65 | /// 66 | internal static string Formats { 67 | get { 68 | return ResourceManager.GetString("Formats", resourceCulture); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Faker/Resources/Phone.de-DE.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | (0###) #########';(0####) #######;+49-###-#######;+49-####-######## 122 | 123 | -------------------------------------------------------------------------------- /src/Faker/Resources/Phone.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | ###-###-####;(###)###-####;1-###-###-####;###.###.####;###-###-####;(###)###-####;1-###-###-####;###.###.####;###-###-#### x###;(###)###-#### x###;1-###-###-#### x###;###.###.#### x###;###-###-#### x####;(###)###-#### x####;1-###-###-#### x####;###.###.#### x####;###-###-#### x#####;(###)###-#### x#####;1-###-###-#### x#####;###.###.#### x##### 122 | 123 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.4.8/Faker.Tests.Net.4.8.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {829BDFF1-A65E-456B-B55E-1D1B7043D939} 9 | Library 10 | Properties 11 | Faker.Tests 12 | Faker.Tests.Net.4.8 13 | v4.8 14 | 512 15 | true 16 | 8.0 17 | 18 | 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | ..\..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | AddressFixture.cs 47 | 48 | 49 | CompanyFixture.cs 50 | 51 | 52 | CountryFixture.cs 53 | 54 | 55 | CultureInfoFixture.cs 56 | 57 | 58 | CurrencyFixture.cs 59 | 60 | 61 | Extensions\ArrayExtensionsFixture.cs 62 | 63 | 64 | Extensions\EnumerableExtensionsFixture.cs 65 | 66 | 67 | Extensions\StringExtensionsFixture.cs 68 | 69 | 70 | FinanceFixture.cs 71 | 72 | 73 | Helpers\UkHelperFixture.cs 74 | 75 | 76 | IdentificationFixture.cs 77 | 78 | 79 | InternetFixture.cs 80 | 81 | 82 | LoremFixture.cs 83 | 84 | 85 | NameFixture.cs 86 | 87 | 88 | PhoneFixture.cs 89 | 90 | 91 | RandomNumberFixture.cs 92 | 93 | 94 | 95 | 96 | 97 | {2d24f94e-41cd-4a14-a9a7-a4f456368ba7} 98 | Faker.Net.4.8 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.4.8/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Faker.Tests.Net.4.8")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Faker.Tests.Net.4.8")] 9 | [assembly: AssemblyCopyright("Copyright © 2020")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | [assembly: ComVisible(false)] 14 | 15 | [assembly: Guid("829bdff1-a65e-456b-b55e-1d1b7043d939")] 16 | 17 | [assembly: AssemblyVersion("1.0.0.0")] 18 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.4.8/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.5.0/Faker.Tests.Net.5.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | Faker.Tests 6 | 8.0 7 | Faker.Tests.Net.5.0 8 | Library 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | all 40 | runtime; build; native; contentfiles; analyzers; buildtransitive 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.6.0/Faker.Tests.Net.6.0.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | Faker.Tests 6 | enable 7 | enable 8 | Faker.Tests.Net.6.0 9 | Library 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | all 41 | runtime; build; native; contentfiles; analyzers; buildtransitive 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.6.02/Faker.Tests.Net.6.02.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | Faker.Tests 6 | Faker.Tests.Net.6.0 7 | enable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/Faker.Tests.Net.Standard.2.1/Faker.Tests.Net.Standard.2.1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | Faker.Tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /tests/Faker.Tests/AddressFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Text.RegularExpressions; 4 | using System.Threading; 5 | using NUnit.Framework; 6 | 7 | namespace Faker.Tests 8 | { 9 | [TestFixture] 10 | public class AddressFixture 11 | { 12 | [SetUp] 13 | public void Setup() 14 | { 15 | Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); 16 | Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); 17 | } 18 | 19 | [Test] 20 | public void Should_Get_MilitaryStateAbbr() 21 | { 22 | var address = Address.UsMilitaryStateAbbr(); 23 | Console.WriteLine($@"UsMilitaryStateAbbr=[{address}]"); 24 | 25 | Assert.IsTrue(address.StartsWith("A", StringComparison.CurrentCultureIgnoreCase)); 26 | } 27 | 28 | [Test] 29 | public void Should_Get_MilitaryState() 30 | { 31 | var address = Address.UsMilitaryState(); 32 | Console.WriteLine($@"UsMilitaryState=[{address}]"); 33 | 34 | Assert.IsTrue(address.StartsWith("Armed", StringComparison.CurrentCultureIgnoreCase)); 35 | } 36 | 37 | [Test] 38 | public void Should_Get_Street_Address() 39 | { 40 | var address = Address.StreetAddress(); 41 | Console.WriteLine($@"StreetAddress=[{address}]"); 42 | 43 | Assert.IsTrue(Regex.IsMatch(address, "^[0-9]{3,5} [A-Z\'a-z]+ [A-Z][a-z]+$")); 44 | } 45 | 46 | [Test] 47 | public void Should_Get_Street_Address_With_Secondary_Address() 48 | { 49 | var address = Address.StreetAddress(true); 50 | Console.WriteLine($@"StreetAddress=[{address}]"); 51 | 52 | Assert.IsTrue(Regex.IsMatch(address, @"^[0-9]{3,5} [A-Z\'a-z]+ [A-Z\'a-z]+ [A-Z\'a-z]+\.? [0-9]{3}$")); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/CompanyFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text.RegularExpressions; 5 | using NUnit.Framework; 6 | 7 | namespace Faker.Tests 8 | { 9 | [TestFixture] 10 | public class CompanyFixture 11 | { 12 | [Test] 13 | public void Should_Generate_Company_Name() 14 | { 15 | var name = Company.Name(); 16 | Console.WriteLine($@"Name=[{name}]"); 17 | 18 | // Name should match one of the given formats 19 | Assert.IsTrue(new List> 20 | { 21 | () => Regex.IsMatch(name, @"\w+ \w+"), 22 | () => Regex.IsMatch(name, @"\w+-\w+"), 23 | () => Regex.IsMatch(name, @"\w+, \w+ and \w+") 24 | }.Any(x => x.Invoke())); 25 | } 26 | 27 | [Test] 28 | public void Should_Generate_Catchphrase() 29 | { 30 | var catchPhrase = Company.CatchPhrase(); 31 | Console.WriteLine($@"CatchPhrase=[{catchPhrase}]"); 32 | 33 | Assert.IsTrue(Regex.IsMatch(catchPhrase, @"[\w\-\/]+ [\w\-\/]+ [\w\-\/]+")); 34 | } 35 | 36 | [Test] 37 | public void Should_Generate_Bs() 38 | { 39 | var bs = Company.BS(); 40 | Console.WriteLine($@"BS=[{bs}]"); 41 | 42 | Assert.IsTrue(Regex.IsMatch(bs, @"[\w\-\/]+ [\w\-\/]+ [\w\-\/]+")); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/CountryFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class CountryFixture 8 | { 9 | [Test] 10 | public void should_return_two_letter_country_code() 11 | { 12 | for (var i = 0; i < 20; i++) 13 | { 14 | var currency = Country.TwoLetterCode(); 15 | Console.WriteLine($@"Iteration=[{i}], TwoLetterCode=[{currency}]"); 16 | 17 | Assert.That(currency.Length, Is.EqualTo(2)); 18 | } 19 | } 20 | 21 | [Test] 22 | public void should_return_country_name() 23 | { 24 | for (var i = 0; i < 20; i++) 25 | { 26 | var name = Country.Name(); 27 | Console.WriteLine($@"Iteration=[{i}], Name=[{name}]"); 28 | 29 | Assert.That(name, Is.Not.Empty); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/CultureInfoFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Threading; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | /// 8 | /// Creating a new CultureInfo (like 'en-bork' from the original Ruby Faker gem) requires windows *admin privileges* 9 | /// according to 10 | /// http://msdn.microsoft.com/en-us/library/ms172469(v=VS.85).aspx 11 | /// That's why 12 | /// (1) we take en-US as default and 13 | /// (2) require de-DE to have an 'extra word' at the beginning of the list within the resx file. 14 | /// In other words: This 'extra word' must differ from the first word in the default (en-US) resx file. 15 | /// And no, we can't access Resource files from another dll directly. 16 | /// 17 | [TestFixture] 18 | public class CultureInfoFixture 19 | { 20 | [SetUp] 21 | public void Setup() 22 | { 23 | SetCultureToDefault(); 24 | } 25 | 26 | [TearDown] 27 | public void TearDown() 28 | { 29 | SetCultureToDefault(); 30 | } 31 | 32 | private const string DefaultCultureInfoString = "en-US"; 33 | 34 | [Test] 35 | public void Should_Be_Default() 36 | { 37 | var expected = GetFirstDefaultWord(); 38 | var actual = Lorem.GetFirstWord(); 39 | Assert.AreEqual(expected, actual); 40 | } 41 | 42 | [Test] 43 | public void Should_Be_German() 44 | { 45 | var expected = GetFirstGermanWord(); 46 | var actual = Lorem.GetFirstWord(); 47 | Assert.AreNotEqual(expected, actual); 48 | } 49 | 50 | private void SetCultureToDefault() 51 | { 52 | var theDefault = new CultureInfo(DefaultCultureInfoString); 53 | Thread.CurrentThread.CurrentCulture = theDefault; 54 | Thread.CurrentThread.CurrentUICulture = theDefault; 55 | } 56 | 57 | private void SetCurrentCulture(string cultureInfoString) 58 | { 59 | Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureInfoString); 60 | Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureInfoString); 61 | } 62 | 63 | private string GetFirstDefaultWord() 64 | { 65 | return Lorem.GetFirstWord(); 66 | } 67 | 68 | private string GetFirstGermanWord() 69 | { 70 | SetCurrentCulture("de-DE"); 71 | var result = Lorem.GetFirstWord(); 72 | SetCultureToDefault(); 73 | return result; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/CurrencyFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class CurrencyFixture 8 | { 9 | [Test] 10 | public void should_return_three_letter_currency_code() 11 | { 12 | for (var i = 0; i < 20; i++) 13 | { 14 | var currency = Currency.ThreeLetterCode(); 15 | Console.WriteLine($@"Iteration=[{i}], ThreeLetterCode=[{currency}]"); 16 | 17 | Assert.That(currency.Length, Is.EqualTo(3)); 18 | } 19 | } 20 | 21 | [Test] 22 | public void should_return_currency_name() 23 | { 24 | for (var i = 0; i < 20; i++) 25 | { 26 | var currency = Currency.Name(); 27 | Console.WriteLine($@"Iteration=[{i}], Name=[{currency}]"); 28 | 29 | Assert.That(currency, Is.Not.Empty); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Extensions/ArrayExtensionsFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Faker.Extensions; 4 | using NUnit.Framework; 5 | 6 | namespace Faker.Tests.Extensions 7 | { 8 | [TestFixture] 9 | public class ArrayExtensionsFixture 10 | { 11 | [Test] 12 | public void Should_Throw_Exception_For_Empty_Array() 13 | { 14 | var exception = Assert.Throws(() => new string[] { }.Random()); 15 | Assert.AreEqual("Array must contain at least one item", exception?.Message); 16 | } 17 | 18 | [Test] 19 | public void Should_Return_Single_Item_From_Array() 20 | { 21 | var s = new[] {"Foo"}.Random(); 22 | Assert.AreEqual("Foo", s); 23 | } 24 | 25 | [Test] 26 | public void Should_Return_All_Array_Items() 27 | { 28 | var input = new[] {"a", "b", "c"}; 29 | var result = 100.Times(x => input.Random()); 30 | 31 | Assert.AreEqual(3, result.Distinct() 32 | .Count()); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Extensions/EnumerableExtensionsFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Faker.Extensions; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests.Extensions 6 | { 7 | [TestFixture] 8 | public class EnumerableExtensionsFixture 9 | { 10 | [Test] 11 | public void Should_Invoke_Func_Given_Number_Of_Times() 12 | { 13 | var numbers = 10.Times(x => x); 14 | Assert.AreEqual(10, numbers.Count()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Extensions/StringExtensionsFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Text.RegularExpressions; 3 | using Faker.Extensions; 4 | using NUnit.Framework; 5 | 6 | namespace Faker.Tests.Extensions 7 | { 8 | [TestFixture] 9 | public class StringExtensionsFixture 10 | { 11 | [Test] 12 | public void Should_Replace_Hash_Char_With_Random_Number() 13 | { 14 | var number = "#".Numerify(); 15 | Assert.IsTrue(Regex.IsMatch(number, "^[0-9]$")); 16 | Assert.AreEqual(1, number.Length); 17 | } 18 | 19 | [Test] 20 | public void Should_Replace_Multiple_Hash_Chars_With_Different_Random_Numbers() 21 | { 22 | var number = "##########".Numerify(); 23 | Assert.IsTrue(Regex.IsMatch(number, "^[0-9]+$")); 24 | Assert.IsTrue(number.Distinct() 25 | .Count() > 1); 26 | Assert.AreEqual(10, number.Length); 27 | } 28 | 29 | [Test] 30 | public void Should_Replace_Question_Mark_With_Random_Letter() 31 | { 32 | var word = "?".Letterify(); 33 | Assert.IsTrue(Regex.IsMatch(word, "^[a-z]$")); 34 | Assert.AreEqual(1, word.Length); 35 | } 36 | 37 | [Test] 38 | public void Should_Replace_Multiple_Question_Marks_With_Different_Random_Letters() 39 | { 40 | var word = "??????????".Letterify(); 41 | Assert.IsTrue(Regex.IsMatch(word, "^[a-z]+$")); 42 | Assert.IsTrue(word.Distinct() 43 | .Count() > 1); 44 | Assert.AreEqual(10, word.Length); 45 | } 46 | 47 | [Test] 48 | public void Should_Replace_Both_Hash_And_Question_Marks() 49 | { 50 | var word = "#?#?".Letterify() 51 | .Numerify(); 52 | Assert.IsTrue(Regex.IsMatch(word, "^[0-9][a-z][0-9][a-z]$")); 53 | Assert.AreEqual(4, word.Length); 54 | } 55 | 56 | [Test] 57 | public void Should_Capitalise_First_Lowercase_Letter() 58 | { 59 | Assert.AreEqual("The quick brown fox", "the quick brown fox".Capitalise()); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Faker.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.21022 7 | 2.0 8 | {23996BF0-3124-4BA1-805C-85E2B6580CB5} 9 | Library 10 | Properties 11 | Faker.Tests 12 | Faker.Tests 13 | v4.8 14 | 512 15 | 16 | 17 | 3.5 18 | 19 | publish\ 20 | true 21 | Disk 22 | false 23 | Foreground 24 | 7 25 | Days 26 | false 27 | false 28 | true 29 | 0 30 | 1.0.0.%2a 31 | false 32 | false 33 | true 34 | ..\..\..\faker-cs\ 35 | true 36 | 37 | 38 | 39 | true 40 | full 41 | false 42 | bin\Debug\ 43 | DEBUG;TRACE 44 | prompt 45 | 4 46 | AllRules.ruleset 47 | false 48 | 49 | 50 | pdbonly 51 | true 52 | bin\Release\ 53 | TRACE 54 | prompt 55 | 4 56 | AllRules.ruleset 57 | false 58 | 59 | 60 | 61 | False 62 | ..\..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll 63 | 64 | 65 | 66 | 3.5 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | False 85 | .NET Framework 3.5 SP1 Client Profile 86 | false 87 | 88 | 89 | False 90 | .NET Framework 3.5 SP1 91 | true 92 | 93 | 94 | False 95 | Windows Installer 3.1 96 | true 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 114 | -------------------------------------------------------------------------------- /tests/Faker.Tests/FinanceFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class FinanceFixture 8 | { 9 | [Test] 10 | public void should_return_an_isin() 11 | { 12 | var isin = Finance.Isin(); 13 | Console.WriteLine($@"Isin=[{isin}]"); 14 | 15 | Assert.That(isin, Is.Not.Empty); 16 | Assert.That(isin.Length, Is.EqualTo(12)); 17 | } 18 | 19 | [Test] 20 | public void should_return_a_ticker() 21 | { 22 | var ticker = Finance.Ticker(); 23 | Console.WriteLine($@"Ticker=[{ticker}]"); 24 | 25 | Assert.That(ticker, Is.Not.Empty); 26 | } 27 | 28 | [Test] 29 | public void should_return_a_coupon() 30 | { 31 | var coupon = Finance.Coupon(); 32 | Console.WriteLine($@"Coupon=[{coupon}]"); 33 | 34 | Assert.That(coupon, Is.GreaterThan(0)); 35 | } 36 | 37 | [Test] 38 | public void should_return_a_maturity_in_the_future() 39 | { 40 | var date = DateTime.Now.Date; 41 | var maturity = Finance.Maturity(); 42 | Console.WriteLine($@"Maturity=[{maturity}]"); 43 | 44 | Assert.That(maturity, Is.GreaterThan(date)); 45 | Assert.That((maturity - date).TotalDays, Is.GreaterThan(180)); 46 | } 47 | 48 | [Test] 49 | public void should_return_a_maturity_in_the_past() 50 | { 51 | var date = DateTime.Now.Date; 52 | var maturity = Finance.Maturity(-120, -6); 53 | Console.WriteLine($@"Maturity=[{maturity}]"); 54 | 55 | Assert.That(maturity, Is.LessThan(date)); 56 | } 57 | 58 | [Test] 59 | public void should_return_a_credit_bond_name() 60 | { 61 | var bondName = Finance.Credit.BondName(); 62 | Console.WriteLine($@"BondName=[{bondName}]"); 63 | 64 | Assert.That(bondName, Is.Not.Empty); 65 | } 66 | 67 | [Test] 68 | public void should_return_a_credit_bond() 69 | { 70 | var bond = Finance.Credit.BondClass(); 71 | Console.WriteLine($@"BondClass=[{bond}]"); 72 | 73 | Assert.That(bond, Is.Not.Null); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Helpers/UkHelperFixture.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | 3 | namespace Faker.Tests.Extensions 4 | { 5 | [TestFixture] 6 | public class UkHelperFixture 7 | { 8 | [TestCase("526948577", ExpectedResult = "10")] 9 | [TestCase("987654432", ExpectedResult = "2")] 10 | [TestCase("549610020", ExpectedResult = "8")] 11 | [TestCase("756227039", ExpectedResult = "2")] 12 | [TestCase("943476591", ExpectedResult = "9")] 13 | public string Nhs_Number_Checksum(string number) 14 | { 15 | var checkSum = UkHelper.CalculateNhsNumberChecksum(number); 16 | return checkSum; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/IdentificationFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | [TestFixture] 8 | public class IdentificationFixture 9 | { 10 | private static readonly Regex NineDigitRegex = new Regex(@"^[0-9]{9,9}$", RegexOptions.Compiled); 11 | private static readonly Regex TenDigitRegex = new Regex(@"^[0-9]{10,10}$", RegexOptions.Compiled); 12 | 13 | private static readonly Regex NhsFormattedDigitRegex = 14 | new Regex(@"^[0-9]{3}[\s]{1}[0-9]{3}[\s]{1}[0-9]{4}$", RegexOptions.Compiled); 15 | 16 | private static readonly Regex MbiRegex = 17 | new Regex( 18 | @"^\b[1-9][AC-HJKMNP-RT-Yac-hjkmnp-rt-y][AC-HJKMNP-RT-Yac-hjkmnp-rt-y0-9][0-9]-?[AC-HJKMNP-RT-Yac-hjkmnp-rt-y][AC-HJKMNP-RT-Yac-hjkmnp-rt-y0-9][0-9]-?[AC-HJKMNP-RT-Yac-hjkmnp-rt-y]{2}\d{2}\b", 19 | RegexOptions.Compiled); 20 | 21 | private static readonly Regex UkNiNumberRegex = 22 | new Regex( 23 | @"^(?!BG|GB|NK|KN|TN|NT|ZZ)[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z](?:\s*\d{2}){3}\s*[A|B|C|D|F|M|P]$"); 24 | 25 | [Test] 26 | public void Should_Create_BG_Pin() 27 | { 28 | var bgPin = Identification.BulgarianPin(); 29 | Console.WriteLine($@"BgPin=[{bgPin}]"); 30 | 31 | Assert.IsTrue(TenDigitRegex.IsMatch(bgPin)); 32 | } 33 | 34 | [Test] 35 | public void Should_Create_DOB() 36 | { 37 | var now = DateTime.UtcNow.Date; 38 | 39 | var dob = Identification.DateOfBirth(); 40 | Console.WriteLine($@"DateOfBirth=[{dob:d}]"); 41 | 42 | Assert.IsTrue(dob < now); 43 | Assert.IsTrue(dob > now.AddYears(Identification.MaxAgeAllowed * -1)); 44 | Assert.That(dob.TimeOfDay, Is.EqualTo(TimeSpan.Zero)); 45 | } 46 | 47 | [Test] 48 | public void Should_Create_US_Mbi() 49 | { 50 | var mbi = Identification.MedicareBeneficiaryIdentifier(); 51 | Console.WriteLine($@"US_MedicareBeneficiaryIdentifier=[{mbi}]"); 52 | 53 | Assert.IsTrue(MbiRegex.IsMatch(mbi)); 54 | } 55 | 56 | [Test] 57 | public void Should_Create_US_SSN() 58 | { 59 | var ssn = new 60 | { 61 | WithDashes = Identification.SocialSecurityNumber(), 62 | Without = Identification.SocialSecurityNumber(false) 63 | }; 64 | 65 | Console.WriteLine($@"US_SocialSecurityNumber=[{ssn.WithDashes}]"); 66 | Assert.IsTrue(Regex.IsMatch(ssn.WithDashes, @"\d{3}-\d{2}-\d{4}")); 67 | Console.WriteLine($@"US_SocialSecurityNumber=[{ssn.Without}]"); 68 | Assert.IsTrue(Regex.IsMatch(ssn.Without, @"\d{9}")); 69 | } 70 | 71 | [Test] 72 | public void Should_Create_UK_Passport_Number() 73 | { 74 | var passport = Identification.UkPassportNumber(); 75 | Console.WriteLine($@"UK_PassportNumber=[{passport}]"); 76 | 77 | Assert.IsTrue(NineDigitRegex.IsMatch(passport)); 78 | } 79 | 80 | [Test] 81 | public void Should_Create_UK_NationalInsurance_Number() 82 | { 83 | for (var i = 0; i < 99; i++) 84 | { 85 | var nin = Identification.UkNationalInsuranceNumber(); 86 | Console.WriteLine($@"Iteration =[{i}], UK_NI_Number=[{nin}]"); 87 | 88 | Assert.IsTrue(UkNiNumberRegex.IsMatch(nin)); 89 | } 90 | } 91 | 92 | [Test] 93 | public void Should_Create_UK_Formatted_NationalInsurance_Number() 94 | { 95 | for (var i = 0; i < 99; i++) 96 | { 97 | var nin = Identification.UkNationalInsuranceNumber(true); 98 | Console.WriteLine($@"Iteration =[{i}], UK_NI_Number =[{nin}]"); 99 | 100 | Assert.IsTrue(UkNiNumberRegex.IsMatch(nin)); 101 | } 102 | } 103 | 104 | [Test] 105 | public void Should_Create_US_Passport_Number() 106 | { 107 | var passport = Identification.UsPassportNumber(); 108 | Console.WriteLine($@"US_Passport_Number=[{passport}]"); 109 | 110 | Assert.IsTrue(NineDigitRegex.IsMatch(passport)); 111 | } 112 | 113 | [Test] 114 | public void Should_Create_UK_Formatted_NHS_Number() 115 | { 116 | for (var i = 0; i < 99; i++) 117 | { 118 | var nhs = Identification.UkNhsNumber(true); 119 | Console.WriteLine($@"Iteration =[{i}], UK_NHS_Number=[{nhs}]"); 120 | 121 | Assert.IsTrue(NhsFormattedDigitRegex.IsMatch(nhs)); 122 | } 123 | } 124 | 125 | [Test] 126 | public void Should_Create_UK_NHS_Number() 127 | { 128 | for (var i = 0; i < 99; i++) 129 | { 130 | var nhs = Identification.UkNhsNumber(); 131 | Console.WriteLine($@"Iteration =[{i}], UK_NHS_Number=[{nhs}]"); 132 | 133 | Assert.IsTrue(TenDigitRegex.IsMatch(nhs)); 134 | } 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/InternetFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | [TestFixture] 8 | public class InternetFixture 9 | { 10 | [Test] 11 | public void Should_Create_Email_Address() 12 | { 13 | var email = Internet.Email(); 14 | Console.WriteLine($@"Email=[{email}]"); 15 | 16 | Assert.IsTrue(Regex.IsMatch(email, @".+@.+\.\w+")); 17 | } 18 | 19 | [Test] 20 | public void Should_Create_Email_Address_From_Given_Name() 21 | { 22 | var email = Internet.Email("Bob Smith"); 23 | Console.WriteLine($@"Email=[{email}]"); 24 | 25 | Assert.IsTrue(Regex.IsMatch(email, @"bob[_\.]smith@.+\.\w+")); 26 | } 27 | 28 | [Test] 29 | public void Should_Create_Free_Email() 30 | { 31 | var email = Internet.FreeEmail(); 32 | Console.WriteLine($@"Email=[{email}]"); 33 | 34 | Assert.IsTrue(Regex.IsMatch(email, @".+@(gmail|hotmail|yahoo)\.com")); 35 | } 36 | 37 | [Test] 38 | public void Should_Create_User_Name() 39 | { 40 | var username = Internet.UserName(); 41 | Console.WriteLine($@"UserName=[{username}]"); 42 | 43 | Assert.IsTrue(Regex.IsMatch(username, @"[a-z]+((_|\.)[a-z]+)?")); 44 | } 45 | 46 | [Test] 47 | public void Should_Create_User_Name_From_Given_Name() 48 | { 49 | var username = Internet.UserName("Bob Smith"); 50 | Console.WriteLine($@"UserName=[{username}]"); 51 | 52 | Assert.IsTrue(Regex.IsMatch(username, @"bob[_\.]smith")); 53 | } 54 | 55 | [Test] 56 | public void Should_Get_Domain_Name() 57 | { 58 | var domain = Internet.DomainName(); 59 | Console.WriteLine($@"DomainName=[{domain}]"); 60 | 61 | Assert.IsTrue(Regex.IsMatch(domain, @"\w+\.\w+")); 62 | } 63 | 64 | [Test] 65 | public void Should_Get_Url() 66 | { 67 | var url = Internet.Url(); 68 | Console.WriteLine($@"Url=[{url}]"); 69 | 70 | Assert.IsTrue(Regex.IsMatch(url, 71 | @"(http:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})")); 72 | } 73 | 74 | [Test] 75 | public void Should_Get_Secure_Url() 76 | { 77 | var url = Internet.SecureUrl(); 78 | Console.WriteLine($@"Url=[{url}]"); 79 | 80 | Assert.IsTrue(Regex.IsMatch(url, 81 | @"(https:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})")); 82 | } 83 | 84 | [Test] 85 | public void Should_Get_Domain_Word() 86 | { 87 | var word = Internet.DomainWord(); 88 | Console.WriteLine($@"DomainWord=[{word}]"); 89 | 90 | Assert.IsTrue(Regex.IsMatch(word, @"^\w+$")); 91 | } 92 | 93 | [Test] 94 | public void Should_Get_Domain_Suffix() 95 | { 96 | var suffix = Internet.DomainSuffix(); 97 | Console.WriteLine($@"DomainSuffix=[{suffix}]"); 98 | 99 | Assert.IsTrue(Regex.IsMatch(suffix, @"^\w+(\.\w+)?")); 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/LoremFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Text.RegularExpressions; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | [TestFixture] 8 | public class LoremFixture 9 | { 10 | [Test] 11 | public void Should_Return_Word_List() 12 | { 13 | var words = Lorem.Words(10); 14 | Assert.AreEqual(10, words.Count()); 15 | } 16 | 17 | [Test] 18 | public void Should_Generate_Random_Word_Sentence() 19 | { 20 | var sentence = Lorem.Sentence(); 21 | Assert.IsTrue(Regex.IsMatch(sentence, @"[A-Z][a-z ]+\.")); 22 | } 23 | 24 | [Test] 25 | public void Should_Generate_Paragraph() 26 | { 27 | var para = Lorem.Paragraph(); 28 | Assert.IsTrue(Regex.IsMatch(para, @"([A-Z][a-z ]+\.\s?){3,6}")); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/NameFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using NUnit.Framework; 5 | #pragma warning disable CS8618 6 | 7 | namespace Faker.Tests 8 | { 9 | [TestFixture] 10 | public class NameFixture 11 | { 12 | [OneTimeSetUp] 13 | public static void SetUp() 14 | { 15 | var prefixes = string.Join("|", Resources.Name.Prefix.Split(Config.Separator) 16 | .Select(x => $"(({x} )?)")); 17 | 18 | var suffixes = string.Join("|", Resources.Name.Suffix.Split(Config.Separator) 19 | .Select(x => $"(( {x})?)")); 20 | 21 | var fullNameRegExString = $@"({prefixes})(\w+?) (\w\'?)(\w+?\-?\w+)({suffixes})"; 22 | var fullNameWithMiddleRegExString = $@"({prefixes})(\w+?) (\w\'?)(\w+\'?) (\w\'?)(\w+?\-?\w+)({suffixes})"; 23 | 24 | _fullNameRegex = new Regex(fullNameRegExString, RegexOptions.Compiled); 25 | _fullNameWithMiddleRegex = new Regex(fullNameWithMiddleRegExString, RegexOptions.Compiled); 26 | } 27 | 28 | private static Regex _fullNameRegex; 29 | private static Regex _fullNameWithMiddleRegex; 30 | 31 | [Test] 32 | public void Should_Get_FullName() 33 | { 34 | for (var i = 0; i < 999; i++) 35 | { 36 | var name = Name.FullName(); 37 | Console.WriteLine($@"Iteration=[{i}], Name=[{name}]"); 38 | 39 | Assert.IsTrue(_fullNameRegex.IsMatch(name)); 40 | } 41 | } 42 | 43 | [Test] 44 | public void Should_Get_FullName_With_Standard_Format() 45 | { 46 | for (var i = 0; i < 99; i++) 47 | { 48 | var name = Name.FullName(NameFormats.Standard); 49 | Console.WriteLine($@"Iteration=[{i}], FullName_Standard_Format=[{name}]"); 50 | 51 | Assert.IsTrue(_fullNameRegex.IsMatch(name)); 52 | } 53 | } 54 | 55 | [Test] 56 | public void Should_Get_FullName_With_Standard_With_Middle_Format() 57 | { 58 | for (var i = 0; i < 99; i++) 59 | { 60 | var name = Name.FullName(NameFormats.StandardWithMiddle); 61 | Console.WriteLine($@"Iteration=[{i}], FullName_Middle_Format=[{name}]"); 62 | 63 | Assert.IsTrue(_fullNameWithMiddleRegex.IsMatch(name)); 64 | } 65 | } 66 | 67 | [Test] 68 | public void Should_Get_FullName_With_Standard_With_Middle_Format_And_Prefix() 69 | { 70 | for (var i = 0; i < 99; i++) 71 | { 72 | var name = Name.FullName(NameFormats.StandardWithMiddleWithPrefix); 73 | Console.WriteLine($@"Iteration=[{i}], FullName_Middle_Format=[{name}]"); 74 | 75 | Assert.IsTrue(_fullNameWithMiddleRegex.IsMatch(name)); 76 | } 77 | } 78 | 79 | [Test] 80 | public void Should_Get_Prefix() 81 | { 82 | var prefix = Name.Prefix(); 83 | Console.WriteLine($@"Prefix=[{prefix}]"); 84 | 85 | Assert.IsTrue(Regex.IsMatch(prefix, @"^[A-Z][a-z]+\.?$")); 86 | } 87 | 88 | [Test] 89 | public void Should_Get_Suffix() 90 | { 91 | var suffix = Name.Suffix(); 92 | Console.WriteLine($@"Suffix=[{suffix}]"); 93 | 94 | Assert.IsTrue(Regex.IsMatch(suffix, @"^[A-Z][A-Za-z]*\.?$")); 95 | } 96 | 97 | [Test] 98 | public void Validate_FullName_Regular_Expressions() 99 | { 100 | var firstNames = Resources.Name.First.Split(Config.Separator) 101 | .ToArray(); 102 | var lastNames = Resources.Name.Last.Split(Config.Separator) 103 | .ToArray(); 104 | 105 | var fullNames = firstNames.SelectMany(firstName => lastNames, 106 | (firstName, lastName) => $"{firstName.Trim()} {lastName.Trim()}") 107 | .ToArray(); 108 | 109 | foreach (var fullName in fullNames) 110 | { 111 | var match = _fullNameRegex.IsMatch(fullName); 112 | if (!match) 113 | Console.WriteLine($@"Name=[{fullName}]"); 114 | 115 | Assert.IsTrue(match); 116 | } 117 | } 118 | } 119 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/PhoneFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | [TestFixture] 8 | public class PhoneFixture 9 | { 10 | [Test] 11 | public void Should_Generate_Phone_Number() 12 | { 13 | var number = Phone.Number(); 14 | Console.WriteLine($@"Number=[{number}]"); 15 | 16 | Assert.IsTrue(Regex.IsMatch(number, @"[0-9 x\-\(\)\.]+")); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Faker.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Faker.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("eb5f7f1f-5dbf-4941-974c-6eb159de604b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /tests/Faker.Tests/RandomNumberFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using NUnit.Framework; 4 | 5 | namespace Faker.Tests 6 | { 7 | [TestFixture] 8 | public class RandomNumberFixture 9 | { 10 | [TestCase(1, "Coin flip")] // 0 ... 1 Coin flip 11 | [TestCase(6, "6 sided die")] // 0 .. 6 12 | [TestCase(9, "Random single digit")] // 0 ... 9 13 | [TestCase(20, "D20")] // 0 ... 20 The signature dice of the dungeons and dragons 14 | public void Should_Generate_All_Positive_Values_From_Zero(int max, string testName) 15 | { 16 | if (max < 0) 17 | throw new ArgumentException(@"Value must be greater than zero!", nameof(max)); 18 | 19 | Console.WriteLine($@"RandomNumber.Next [{testName}]"); 20 | 21 | var results = new Dictionary(); 22 | do 23 | { 24 | var value = RandomNumber.Next(0, max); 25 | 26 | if (value < 0) 27 | throw new Exception($"Value is less than zero, value=[{value}]"); 28 | 29 | results[value] = value; 30 | 31 | Console.WriteLine($@"RandomNumber.Next(0,{max})=[{value}]"); 32 | } while (results.Count != max - 0); 33 | } 34 | 35 | [TestCase(-1000, "Negative 1000 Numbers")] 36 | public void Should_Generate_All_Negative_Values_To_Zero(int min, string testName) 37 | { 38 | if (min > 0) 39 | throw new ArgumentException(@"Value must be less than zero!", nameof(min)); 40 | 41 | var results = new Dictionary(); 42 | do 43 | { 44 | var value = RandomNumber.Next(min,0); 45 | 46 | if (value > 0) 47 | throw new Exception($"Value is greater than zero, value=[{value}]"); 48 | 49 | results[value] = value; 50 | 51 | Console.WriteLine($@"RandomNumber.Next({min}, 0)=[{value}]"); 52 | } while (results.Count != min * -1); 53 | } 54 | 55 | [Test] 56 | public void Should_Create_Zero() 57 | { 58 | var zero = RandomNumber.Next(0, 0); 59 | Console.WriteLine($@"RandomNumber.Next(0,0)=[{zero}]"); 60 | 61 | Assert.IsTrue(zero == 0); 62 | } 63 | 64 | [Test] 65 | public void Should_Generate_Maximum() 66 | { 67 | var result = false; 68 | for (var i = 0; i < 1000000; i++) 69 | { 70 | var number = RandomNumber.Next(0, 1); 71 | if (number == 1) 72 | { 73 | result = true; 74 | break; 75 | } 76 | } 77 | 78 | Assert.IsTrue(result); 79 | } 80 | 81 | [Test] 82 | public void Should_Generate_Minimum() 83 | { 84 | var result = false; 85 | for (var i = 0; i < 1000000; i++) 86 | { 87 | var number = RandomNumber.Next(0, 1); 88 | if (number == 0) 89 | { 90 | result = true; 91 | break; 92 | } 93 | } 94 | 95 | Assert.IsTrue(result); 96 | } 97 | 98 | [Test] 99 | public void Should_Generate_To_Int32_Max_Value() 100 | { 101 | var results = new Dictionary(); 102 | var min = int.MaxValue - 1000; 103 | var max = int.MaxValue; 104 | 105 | do 106 | { 107 | var value = RandomNumber.Next(min, max); 108 | 109 | if (value < min) 110 | throw new Exception($"Value is less than min, value=[{value}], min=[{min}]"); 111 | 112 | results[value] = value; 113 | 114 | Console.WriteLine($@"RandomNumber.Next({min},{max})=[{value}]"); 115 | } while (results.Count != 1000); 116 | 117 | Assert.That(results.ContainsKey(min)); 118 | Assert.That(results.ContainsKey(max)); 119 | } 120 | 121 | [Test] 122 | public void Should_Generate_To_Int64_Max_Value() 123 | { 124 | var results = new Dictionary(); 125 | var min = long.MaxValue - 1000; 126 | var max = long.MaxValue; 127 | 128 | do 129 | { 130 | var value = RandomNumber.Next(min, max); 131 | 132 | if (value < min) 133 | throw new Exception($"Value is less than min, value=[{value}], min=[{min}]"); 134 | 135 | results[value] = value; 136 | 137 | Console.WriteLine($@"RandomNumber.Next({min},{max})=[{value}]"); 138 | } while (results.Count != 1000); 139 | 140 | Assert.That(results.ContainsKey(min)); 141 | Assert.That(results.ContainsKey(max)); 142 | } 143 | 144 | [Test] 145 | public void Should_Generate_To_Int32_Min_Value() 146 | { 147 | var results = new Dictionary(); 148 | var min = int.MinValue; 149 | var max = min + 1000; 150 | 151 | do 152 | { 153 | var value = RandomNumber.Next(min, max); 154 | 155 | if (value > max) 156 | throw new Exception($"Value is greater than max, value=[{value}], max=[{max}]"); 157 | 158 | results[value] = value; 159 | 160 | Console.WriteLine($@"RandomNumber.Next({min},{max})=[{value}]"); 161 | } while (results.Count != 1000); 162 | 163 | Assert.That(results.ContainsKey(min)); 164 | Assert.That(results.ContainsKey(max)); 165 | } 166 | 167 | [Test] 168 | public void Should_Generate_To_Int64_Min_Value() 169 | { 170 | var results = new Dictionary(); 171 | var min = long.MinValue; 172 | var max = min + 1000; 173 | 174 | do 175 | { 176 | var value = RandomNumber.Next(min, max); 177 | 178 | if (value > max) 179 | throw new Exception($"Value is greater than max, value=[{value}], max=[{max}]"); 180 | 181 | results[value] = value; 182 | 183 | Console.WriteLine($@"RandomNumber.Next({min},{max})=[{value}]"); 184 | } while (results.Count != 1000); 185 | 186 | Assert.That(results.ContainsKey(min)); 187 | Assert.That(results.ContainsKey(max)); 188 | } 189 | 190 | [Test] 191 | public void Should_Generate_Values_Greater_Than_Zero() 192 | { 193 | var result = true; 194 | for (var i = 0; i < 1000; i++) 195 | { 196 | var number = RandomNumber.Next(); 197 | Console.WriteLine(number); 198 | if (number < 0) 199 | { 200 | result = false; 201 | break; 202 | } 203 | } 204 | 205 | Assert.IsTrue(result); 206 | } 207 | } 208 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------