├── .gitignore ├── .nuget ├── NuGet.Config ├── NuGet.exe └── NuGet.targets ├── Faker (NET4).sln ├── Faker (SL3).sln ├── Faker (SL4).sln ├── Faker (SL5).sln ├── Faker (WP7).sln ├── Faker (WP71).sln ├── Faker.Net.1.0.3.nupkg ├── Faker.sln ├── LICENSE ├── README.markdown ├── packages ├── NUnit.2.5.10.11092 │ ├── Logo.ico │ ├── NUnit.2.5.10.11092.nupkg │ ├── NUnitFitTests.html │ ├── fit-license.txt │ ├── lib │ │ ├── nunit.framework.dll │ │ ├── nunit.framework.xml │ │ ├── nunit.mocks.dll │ │ └── pnunit.framework.dll │ ├── license.txt │ └── tools │ │ ├── NUnitTests.VisualState.xml │ │ ├── NUnitTests.config │ │ ├── NUnitTests.nunit │ │ ├── TestResult.xml │ │ ├── agent.conf │ │ ├── agent.log.conf │ │ ├── launcher.log.conf │ │ ├── lib │ │ ├── Failure.png │ │ ├── Ignored.png │ │ ├── Inconclusive.png │ │ ├── Skipped.png │ │ ├── Success.png │ │ ├── fit.dll │ │ ├── log4net.dll │ │ ├── nunit-console-runner.dll │ │ ├── nunit-gui-runner.dll │ │ ├── nunit.core.dll │ │ ├── nunit.core.interfaces.dll │ │ ├── nunit.fixtures.dll │ │ ├── nunit.uiexception.dll │ │ ├── nunit.uikit.dll │ │ └── nunit.util.dll │ │ ├── nunit-agent-x86.exe │ │ ├── nunit-agent-x86.exe.config │ │ ├── nunit-agent.exe │ │ ├── nunit-agent.exe.config │ │ ├── nunit-console-x86.exe │ │ ├── nunit-console-x86.exe.config │ │ ├── nunit-console.exe │ │ ├── nunit-console.exe.config │ │ ├── nunit-x86.exe │ │ ├── nunit-x86.exe.config │ │ ├── nunit.exe │ │ ├── nunit.exe.config │ │ ├── nunit.framework.dll │ │ ├── pnunit-agent.exe │ │ ├── pnunit-agent.exe.config │ │ ├── pnunit-launcher.exe │ │ ├── pnunit-launcher.exe.config │ │ ├── pnunit.framework.dll │ │ ├── pnunit.tests.dll │ │ ├── runFile.exe │ │ ├── runFile.exe.config │ │ ├── runpnunit.bat │ │ └── test.conf ├── NUnit.2.6.0.12054 │ ├── NUnit.2.6.0.12054.nupkg │ ├── lib │ │ ├── nunit.framework.dll │ │ └── nunit.framework.xml │ └── license.txt └── repositories.config ├── src ├── Faker.NET4 │ ├── Faker.NET4.csproj │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 ├── Faker.SL3 │ ├── Extensions │ │ └── StringExtensions.cs │ ├── Faker.SL3.csproj │ ├── Internet.cs │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 ├── Faker.SL4 │ ├── Extensions │ │ └── StringExtensions.cs │ ├── Faker (SL4).csproj │ ├── Internet.cs │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 ├── Faker.SL5 │ ├── Extensions │ │ └── StringExtensions.cs │ ├── Faker (SL5).csproj │ ├── Internet.cs │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 ├── Faker.WP7 │ ├── Faker.WP7.csproj │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 ├── Faker.WP71 │ ├── Faker (WP71).csproj │ └── Resources │ │ ├── Address.Designer.cs │ │ ├── Address.de-DE.resx │ │ ├── Address.resx │ │ ├── Company.Designer.cs │ │ ├── Company.de-DE.resx │ │ ├── Company.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 └── Faker │ ├── Address.cs │ ├── Company.cs │ ├── Config.cs │ ├── Events.cs │ ├── Extensions │ ├── ArrayExtensions.cs │ ├── EnumerableExtensions.cs │ └── StringExtensions.cs │ ├── Faker.csproj │ ├── Internet.cs │ ├── Lorem.cs │ ├── Name.cs │ ├── Phone.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RandomNumber.cs │ └── Resources │ ├── Address.Designer.cs │ ├── Address.de-DE.resx │ ├── Address.pt-BR.Designer.cs │ ├── Address.pt-BR.resx │ ├── Address.resx │ ├── Company.Designer.cs │ ├── Company.de-DE.resx │ ├── Company.resx │ ├── Events.Designer.cs │ ├── Events.resx │ ├── Internet.Designer.cs │ ├── Internet.de-DE.resx │ ├── Internet.pt-BR.Designer.cs │ ├── Internet.pt-BR.resx │ ├── Internet.resx │ ├── Lorem.Designer.cs │ ├── Lorem.de-DE.resx │ ├── Lorem.resx │ ├── Name.Designer.cs │ ├── Name.de-DE.resx │ ├── Name.pt-BR.Designer.cs │ ├── Name.pt-BR.resx │ ├── Name.resx │ ├── Phone.Designer.cs │ ├── Phone.de-DE.resx │ ├── Phone.pt-BR.Designer.cs │ ├── Phone.pt-BR.resx │ └── Phone.resx └── tests └── Faker.Tests ├── AddressFixture.cs ├── CompanyFixture.cs ├── CultureInfoFixture.cs ├── EventsFixture.cs ├── Extensions ├── ArrayExtensionsFixture.cs ├── EnumerableExtensionsFixture.cs └── StringExtensionsFixture.cs ├── Faker.Tests.csproj ├── InternetFixture.cs ├── LoremFixture.cs ├── NameFixture.cs ├── PhoneFixture.cs ├── Properties └── AssemblyInfo.cs └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | *.user 4 | *.suo 5 | _ReSharper.* 6 | *.sln.cache 7 | _UpgradeReport_Files* 8 | UpgradeLog.XML 9 | *.ncrunchsolution 10 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/.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 (NET4).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker.NET4", "src\Faker.NET4\Faker.NET4.csproj", "{FFB599BB-8FCA-4A01-A159-4D764A33E755}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {FFB599BB-8FCA-4A01-A159-4D764A33E755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {FFB599BB-8FCA-4A01-A159-4D764A33E755}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {FFB599BB-8FCA-4A01-A159-4D764A33E755}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {FFB599BB-8FCA-4A01-A159-4D764A33E755}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker (SL3).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker.SL3", "src\Faker.SL3\Faker.SL3.csproj", "{DD3C80B6-AFD8-401C-81F4-7F74398455AD}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {DD3C80B6-AFD8-401C-81F4-7F74398455AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {DD3C80B6-AFD8-401C-81F4-7F74398455AD}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {DD3C80B6-AFD8-401C-81F4-7F74398455AD}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {DD3C80B6-AFD8-401C-81F4-7F74398455AD}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker (SL4).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker (SL4)", "src\Faker.SL4\Faker (SL4).csproj", "{D7B9A874-2C45-4748-B990-73647C327249}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {D7B9A874-2C45-4748-B990-73647C327249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {D7B9A874-2C45-4748-B990-73647C327249}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {D7B9A874-2C45-4748-B990-73647C327249}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {D7B9A874-2C45-4748-B990-73647C327249}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker (SL5).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker (SL5)", "src\Faker.SL5\Faker (SL5).csproj", "{BDA95236-74FC-4757-9D0A-6CC9C17481B7}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {BDA95236-74FC-4757-9D0A-6CC9C17481B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {BDA95236-74FC-4757-9D0A-6CC9C17481B7}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {BDA95236-74FC-4757-9D0A-6CC9C17481B7}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {BDA95236-74FC-4757-9D0A-6CC9C17481B7}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker (WP7).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker.WP7", "src\Faker.WP7\Faker.WP7.csproj", "{B65C5636-2CC4-4507-9F77-70E6EB274798}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B65C5636-2CC4-4507-9F77-70E6EB274798}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {B65C5636-2CC4-4507-9F77-70E6EB274798}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {B65C5636-2CC4-4507-9F77-70E6EB274798}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {B65C5636-2CC4-4507-9F77-70E6EB274798}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker (WP71).sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker (WP71)", "src\Faker.WP71\Faker (WP71).csproj", "{B6F8E8FE-3643-4AB1-9319-EB9330D3DC7E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B6F8E8FE-3643-4AB1-9319-EB9330D3DC7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {B6F8E8FE-3643-4AB1-9319-EB9330D3DC7E}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {B6F8E8FE-3643-4AB1-9319-EB9330D3DC7E}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {B6F8E8FE-3643-4AB1-9319-EB9330D3DC7E}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Faker.Net.1.0.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/Faker.Net.1.0.3.nupkg -------------------------------------------------------------------------------- /Faker.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker", "src\Faker\Faker.csproj", "{598D73F1-9EBD-494A-A244-7AA4E7FB7591}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faker.Tests", "tests\Faker.Tests\Faker.Tests.csproj", "{23996BF0-3124-4BA1-805C-85E2B6580CB5}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{EA359FE6-BCD0-40CB-8BB8-3028A94E5E32}" 9 | ProjectSection(SolutionItems) = preProject 10 | .nuget\NuGet.exe = .nuget\NuGet.exe 11 | .nuget\NuGet.targets = .nuget\NuGet.targets 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {598D73F1-9EBD-494A-A244-7AA4E7FB7591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {598D73F1-9EBD-494A-A244-7AA4E7FB7591}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {598D73F1-9EBD-494A-A244-7AA4E7FB7591}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {598D73F1-9EBD-494A-A244-7AA4E7FB7591}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {23996BF0-3124-4BA1-805C-85E2B6580CB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {23996BF0-3124-4BA1-805C-85E2B6580CB5}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {23996BF0-3124-4BA1-805C-85E2B6580CB5}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {23996BF0-3124-4BA1-805C-85E2B6580CB5}.Release|Any CPU.Build.0 = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Ben Smith 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 | 4 | C# port of the Ruby Faker gem (http://faker.rubyforge.org/) and is used to easily generate fake data: 5 | names, addresses, phone numbers, etc. 6 | 7 | Available as a NuGet package (https://nuget.org/packages/Faker.Net). 8 | 9 | Get the code via git: 10 | 11 | git clone git://github.com/slashdotdash/faker-cs.git 12 | 13 | Supported version: 14 | 15 | .NET framework 3.5 SP1, 16 | .NET framework 4.0, 17 | Silverlight 3.0, 18 | Silverlight 4.0, 19 | Silverlight 5.0, 20 | Windows Phone 7, 21 | Windows Phone 7.1, 22 | 23 | ## Usage 24 | 25 | Add a reference to `Faker.dll` in your project within Visual Studio. 26 | 27 | Start using the Faker methods to generate your random test data. 28 | 29 | ### Names, phone numbers and emails 30 | 31 | var name = Faker.Name.FullName(); // "Alene Hayes" 32 | Faker.Internet.Email(name); // "alene_hayes@hartmann.co.uk" 33 | Faker.Internet.UserName(name); // "alene.hayes" 34 | 35 | Faker.Internet.Email(); // "morris@friesen.us" 36 | Faker.Internet.FreeEmail(); // "houston_purdy@yahoo.com" 37 | 38 | Faker.Internet.DomainName(); // "larkinhirthe.com" 39 | 40 | Faker.Phone.Number(); // "(033)216-0058 x0344" 41 | 42 | ### Addresses 43 | 44 | Faker.Address.StreetAddress(); // "52613 Turcotte Lock" 45 | Faker.Address.SecondaryAddress(); // "Suite 656" 46 | Faker.Address.City(); // "South Wavaside" 47 | 48 | Faker.Address.UkCounty(); // "West Glamorgan" 49 | Faker.Address.UkPostCode().ToUpper(); // "BQ7 3AM" 50 | 51 | Faker.Address.UsState(); // "Tennessee" 52 | Faker.Address.ZipCode(); // "66363-7828" 53 | 54 | ### Lorem Ipsum sentences and paragraphs 55 | 56 | Faker.Lorem.Sentence(); // "Voluptatem repudiandae necessitatibus assumenda dolor illo maiores in." 57 | Faker.Lorem.Paragraph(); /* "Rerum dolor cumque cum animi consequatur praesentium. Enim quia quia modi est ut. Dolores qui debitis qui perspiciatis autem quas. Expedita distinctio earum aut. Delectus assumenda rerum quibusdam harum iusto." */ 58 | 59 | ### Buzzword bingo 60 | 61 | Last, but not least, you can generate company names, catchphrases and bs! 62 | 63 | Faker.Company.Name(); // "Dickens Group" 64 | Faker.Company.CatchPhrase(); // "User-centric neutral internet solution" 65 | Faker.Company.BS(); // "transition proactive solution" 66 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/Logo.ico -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/license.txt -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/NUnitTests.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/agent.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/launcher.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/Failure.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/Success.png -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/fit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/fit.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit-console.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.5.10.11092/tools/runFile.exe -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runFile.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent agent.conf 2 | pnunit-launcher test.conf -------------------------------------------------------------------------------- /packages/NUnit.2.5.10.11092/tools/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing 6 | 7 | 8 | Testing 9 | pnunit.tests.dll 10 | TestLibraries.Testing.EqualTo19 11 | localhost:8080 12 | 13 | ..\server 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg -------------------------------------------------------------------------------- /packages/NUnit.2.6.0.12054/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.6.0.12054/lib/nunit.framework.dll -------------------------------------------------------------------------------- /packages/NUnit.2.6.0.12054/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/packages/NUnit.2.6.0.12054/license.txt -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Faker.NET4/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.NET4.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.NET4/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.NET4.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.NET4/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal 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.NET4.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.NET4/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.NET4.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.SL3/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace Faker.Extensions 4 | { 5 | public static class StringExtensions 6 | { 7 | 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(' '); 8 | 9 | /// 10 | /// Get a string with every occurence of '#' replaced with a random number. 11 | /// 12 | public static string Numerify(this string s) 13 | { 14 | return Regex.Replace(s, "#", new MatchEvaluator((m) => RandomNumber.Next(0, 9).ToString())); 15 | } 16 | 17 | /// 18 | /// Get a string with every '?' replaced with a random character from the alphabet. 19 | /// 20 | public static string Letterify(this string s) 21 | { 22 | return Regex.Replace(s, @"\?", new MatchEvaluator((m) => _alphabet.Random())); 23 | } 24 | 25 | public static string AlphanumericOnly(this string s) 26 | { 27 | return Regex.Replace(s, @"\W", ""); 28 | } 29 | 30 | /// 31 | /// Capitalise the first letter of the given string. 32 | /// 33 | /// 34 | /// 35 | public static string Capitalise(this string s) 36 | { 37 | return Regex.Replace(s, "^[a-z]", new MatchEvaluator(x => x.Value.ToUpper())); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Faker.SL3/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 | public static string Email() 12 | { 13 | return String.Format("{0}@{1}", UserName(), DomainName()); 14 | } 15 | 16 | public static string Email(string name) 17 | { 18 | return String.Format("{0}@{1}", UserName(name), DomainName()); 19 | } 20 | 21 | public static string FreeEmail() 22 | { 23 | return String.Format("{0}@{1}", UserName(), Resources.Internet.FreeMail.Split(Config.Separator).Random()); 24 | } 25 | 26 | public static string UserName() 27 | { 28 | return _userNameFormats.Random(); 29 | } 30 | 31 | public static string UserName(string name) 32 | { 33 | return Regex.Replace(name, @"[^\w]+", new MatchEvaluator(x => new[] { ".", "_" }.Random())).ToLower(); 34 | } 35 | 36 | public static string DomainName() 37 | { 38 | return String.Format("{0}.{1}", DomainWord(), DomainSuffix()); 39 | } 40 | 41 | public static string DomainWord() 42 | { 43 | return Company.Name().Split(' ').First().AlphanumericOnly().ToLower(); 44 | } 45 | 46 | public static string DomainSuffix() 47 | { 48 | return Resources.Internet.DomainSuffix.Split(Config.Separator).Random(); 49 | } 50 | 51 | private static readonly IEnumerable> _userNameFormats = new List> 52 | { 53 | () => Name.First().AlphanumericOnly().ToLower(), 54 | () => string.Format("{0}{1}{2}", Name.First().AlphanumericOnly(), 55 | new [] { ".", "_" }.Random(), Name.Last().AlphanumericOnly()).ToLower() 56 | }; 57 | } 58 | } -------------------------------------------------------------------------------- /src/Faker.SL3/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL3.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.SL3/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL3.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.SL3/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal 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.SL3.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.SL3/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL3.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.SL4/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace Faker.Extensions 4 | { 5 | public static class StringExtensions 6 | { 7 | 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(' '); 8 | 9 | /// 10 | /// Get a string with every occurence of '#' replaced with a random number. 11 | /// 12 | public static string Numerify(this string s) 13 | { 14 | return Regex.Replace(s, "#", new MatchEvaluator((m) => RandomNumber.Next(0, 9).ToString())); 15 | } 16 | 17 | /// 18 | /// Get a string with every '?' replaced with a random character from the alphabet. 19 | /// 20 | public static string Letterify(this string s) 21 | { 22 | return Regex.Replace(s, @"\?", new MatchEvaluator((m) => _alphabet.Random())); 23 | } 24 | 25 | public static string AlphanumericOnly(this string s) 26 | { 27 | return Regex.Replace(s, @"\W", ""); 28 | } 29 | 30 | /// 31 | /// Capitalise the first letter of the given string. 32 | /// 33 | /// 34 | /// 35 | public static string Capitalise(this string s) 36 | { 37 | return Regex.Replace(s, "^[a-z]", new MatchEvaluator(x => x.Value.ToUpperInvariant())); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Faker.SL4/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 | public static string Email() 12 | { 13 | return String.Format("{0}@{1}", UserName(), DomainName()); 14 | } 15 | 16 | public static string Email(string name) 17 | { 18 | return String.Format("{0}@{1}", UserName(name), DomainName()); 19 | } 20 | 21 | public static string FreeEmail() 22 | { 23 | return String.Format("{0}@{1}", UserName(), Resources.Internet.FreeMail.Split(Config.Separator).Random()); 24 | } 25 | 26 | public static string UserName() 27 | { 28 | return _userNameFormats.Random(); 29 | } 30 | 31 | public static string UserName(string name) 32 | { 33 | return Regex.Replace(name, @"[^\w]+", new MatchEvaluator(x => new [] { ".", "_" }.Random())).ToLowerInvariant(); 34 | } 35 | 36 | public static string DomainName() 37 | { 38 | return String.Format("{0}.{1}", DomainWord(), DomainSuffix()); 39 | } 40 | 41 | public static string DomainWord() 42 | { 43 | return Company.Name().Split(' ').First().AlphanumericOnly().ToLowerInvariant(); 44 | } 45 | 46 | public static string DomainSuffix() 47 | { 48 | return Resources.Internet.DomainSuffix.Split(Config.Separator).Random(); 49 | } 50 | 51 | private static readonly IEnumerable> _userNameFormats = new List> 52 | { 53 | () => Name.First().AlphanumericOnly().ToLowerInvariant(), 54 | () => string.Format("{0}{1}{2}", Name.First().AlphanumericOnly(), 55 | new [] { ".", "_" }.Random(), Name.Last().AlphanumericOnly()).ToLowerInvariant() 56 | }; 57 | } 58 | } -------------------------------------------------------------------------------- /src/Faker.SL4/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL4.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.SL4/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL4.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.SL4/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal 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.SL4.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.SL4/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL4.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.SL5/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace Faker.Extensions 4 | { 5 | public static class StringExtensions 6 | { 7 | 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(' '); 8 | 9 | /// 10 | /// Get a string with every occurence of '#' replaced with a random number. 11 | /// 12 | public static string Numerify(this string s) 13 | { 14 | return Regex.Replace(s, "#", new MatchEvaluator((m) => RandomNumber.Next(0, 9).ToString())); 15 | } 16 | 17 | /// 18 | /// Get a string with every '?' replaced with a random character from the alphabet. 19 | /// 20 | public static string Letterify(this string s) 21 | { 22 | return Regex.Replace(s, @"\?", new MatchEvaluator((m) => _alphabet.Random())); 23 | } 24 | 25 | public static string AlphanumericOnly(this string s) 26 | { 27 | return Regex.Replace(s, @"\W", ""); 28 | } 29 | 30 | /// 31 | /// Capitalise the first letter of the given string. 32 | /// 33 | /// 34 | /// 35 | public static string Capitalise(this string s) 36 | { 37 | return Regex.Replace(s, "^[a-z]", new MatchEvaluator(x => x.Value.ToUpperInvariant())); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Faker.SL5/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 | public static string Email() 12 | { 13 | return String.Format("{0}@{1}", UserName(), DomainName()); 14 | } 15 | 16 | public static string Email(string name) 17 | { 18 | return String.Format("{0}@{1}", UserName(name), DomainName()); 19 | } 20 | 21 | public static string FreeEmail() 22 | { 23 | return String.Format("{0}@{1}", UserName(), Resources.Internet.FreeMail.Split(Config.Separator).Random()); 24 | } 25 | 26 | public static string UserName() 27 | { 28 | return _userNameFormats.Random(); 29 | } 30 | 31 | public static string UserName(string name) 32 | { 33 | return Regex.Replace(name, @"[^\w]+", new MatchEvaluator(x => new [] { ".", "_" }.Random())).ToLowerInvariant(); 34 | } 35 | 36 | public static string DomainName() 37 | { 38 | return String.Format("{0}.{1}", DomainWord(), DomainSuffix()); 39 | } 40 | 41 | public static string DomainWord() 42 | { 43 | return Company.Name().Split(' ').First().AlphanumericOnly().ToLowerInvariant(); 44 | } 45 | 46 | public static string DomainSuffix() 47 | { 48 | return Resources.Internet.DomainSuffix.Split(Config.Separator).Random(); 49 | } 50 | 51 | private static readonly IEnumerable> _userNameFormats = new List> 52 | { 53 | () => Name.First().AlphanumericOnly().ToLowerInvariant(), 54 | () => string.Format("{0}{1}{2}", Name.First().AlphanumericOnly(), 55 | new [] { ".", "_" }.Random(), Name.Last().AlphanumericOnly()).ToLowerInvariant() 56 | }; 57 | } 58 | } -------------------------------------------------------------------------------- /src/Faker.SL5/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL5.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.SL5/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL5.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.SL5/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal 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.SL5.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.SL5/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.SL5.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.WP7/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP7.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.WP7/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP7.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.WP7/Resources/Name.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal 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.WP7.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.WP7/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP7.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.WP71/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP71.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker.WP71/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP71.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.WP71/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 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", "4.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.WP71.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/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 | public static string Country() 10 | { 11 | return Resources.Address.Country.Split(Config.Separator).Random().Trim(); 12 | } 13 | 14 | public static string ZipCode() 15 | { 16 | return Resources.Address.ZipCode.Split(Config.Separator).Random().Trim().Numerify(); 17 | } 18 | 19 | public static string UsState() 20 | { 21 | 22 | return Resources.Address.UsState.Split(Config.Separator).Random().Trim(); 23 | } 24 | 25 | public static string UsStateAbbr() 26 | { 27 | return Resources.Address.UsStateAbbr.Split(Config.Separator).Random(); 28 | } 29 | 30 | public static string CityPrefix() 31 | { 32 | return Resources.Address.CityPrefix.Split(Config.Separator).Random(); 33 | } 34 | 35 | public static string CitySufix() 36 | { 37 | return Resources.Address.CitySufix.Split(Config.Separator).Random(); 38 | } 39 | 40 | public static string City() 41 | { 42 | return _cityFormats.Random(); 43 | } 44 | 45 | public static string StreetSuffix() 46 | { 47 | return Resources.Address.StreetSuffix.Split(Config.Separator).Random(); 48 | } 49 | 50 | public static string StreetName() 51 | { 52 | return String.Join(Resources.Address.StreetNameSeparator, _streetFormats.Random()); 53 | } 54 | 55 | public static string StreetAddress() 56 | { 57 | return StreetAddress(false); 58 | } 59 | 60 | public static string StreetAddress(bool includeSecondary) 61 | { 62 | return _streetAddressFormats.Random().Numerify() + (includeSecondary ? " " + SecondaryAddress() : ""); 63 | } 64 | 65 | public static string SecondaryAddress() 66 | { 67 | return Resources.Address.SecondaryAddress.Split(Config.Separator).Random().Trim().Numerify(); 68 | } 69 | 70 | public static string UkCounty() 71 | { 72 | return Resources.Address.UkCounties.Split(Config.Separator).Random().Trim(); 73 | } 74 | 75 | public static string UkCountry() 76 | { 77 | return Resources.Address.UkCountry.Split(Config.Separator).Random().Trim(); 78 | } 79 | 80 | public static string UkPostCode() 81 | { 82 | return Resources.Address.UkPostCode.Split(Config.Separator).Random().Trim().Numerify().Letterify(); 83 | } 84 | 85 | public static LatLng LatLng() 86 | { 87 | Random rnd = new Random(); 88 | double lat = Math.Round((rnd.NextDouble()*170)- 85, 4); // between -85 to 85 89 | double lng = Math.Round((rnd.NextDouble()*360) - 180, 4); // between -180 to 180 90 | return new LatLng(lat, lng); 91 | } 92 | 93 | #region Format Mappings 94 | private static readonly IEnumerable> _cityFormats = new List> 95 | { 96 | () => string.Format("{0} {1}{2}", CityPrefix(), Name.First(), CitySufix()), 97 | () => string.Format("{0} {1}", CityPrefix(), Name.First()), 98 | () => string.Format("{0}{1}", Name.First(), CitySufix()), 99 | () => string.Format("{0}{1}", Name.Last(), CitySufix()) 100 | }; 101 | 102 | private static readonly IEnumerable> _streetFormats = new List> 103 | { 104 | () => new [] { Name.Last(), StreetSuffix() }, 105 | () => new [] { Name.First(), StreetSuffix() } 106 | }; 107 | 108 | private static readonly IEnumerable> _streetAddressFormats = new List> 109 | { 110 | () => string.Format(Resources.Address.AddressFormat.Split(Config.Separator).Random().Trim(), StreetName()) 111 | }; 112 | #endregion 113 | } 114 | 115 | public class LatLng 116 | { 117 | public double Lat { get; set; } 118 | public double Lng { get; set; } 119 | 120 | public LatLng(double lat, double lng) 121 | { 122 | Lat = lat; 123 | Lng = lng; 124 | } 125 | } 126 | } -------------------------------------------------------------------------------- /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 | public static string Name() 10 | { 11 | return NameFormats.Random(); 12 | } 13 | 14 | public static string Suffix() 15 | { 16 | return Resources.Company.Suffix.Split(Config.Separator).Random(); 17 | } 18 | 19 | /// 20 | /// Generate a buzzword-laden catch phrase. 21 | /// Wordlist from http://www.1728.com/buzzword.htm 22 | /// 23 | public static string CatchPhrase() 24 | { 25 | return String.Join(" ", 26 | new[] 27 | { 28 | Resources.Company.Buzzwords1.Split(Config.Separator).Random(), 29 | Resources.Company.Buzzwords2.Split(Config.Separator).Random(), 30 | Resources.Company.Buzzwords3.Split(Config.Separator).Random() 31 | }); 32 | } 33 | 34 | /// 35 | /// When a straight answer won't do, BS to the rescue! 36 | /// Wordlist from http://dack.com/web/bullshit.html 37 | /// 38 | public static string BS() 39 | { 40 | return String.Join(" ", 41 | new[] 42 | { 43 | Resources.Company.BS1.Split(Config.Separator).Random(), 44 | Resources.Company.BS2.Split(Config.Separator).Random(), 45 | Resources.Company.BS3.Split(Config.Separator).Random() 46 | }); 47 | } 48 | 49 | #region Format Mappings 50 | private static readonly IEnumerable> NameFormats = new List> 51 | { 52 | () => string.Format("{0} {1}", Faker.Name.Last(), Suffix()), 53 | () => string.Format("{0}-{1}", Faker.Name.Last(), Faker.Name.Last()), 54 | () => string.Format("{0}, {1} {2} {3}", Faker.Name.Last(), Faker.Name.Last(), Resources.Company.And, Faker.Name.Last()), 55 | }; 56 | #endregion 57 | } 58 | } -------------------------------------------------------------------------------- /src/Faker/Config.cs: -------------------------------------------------------------------------------- 1 | namespace Faker 2 | { 3 | public static class Config 4 | { 5 | private static char _separator = ';'; 6 | public static char Separator { get { return _separator; } set { _separator = value; } } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/Faker/Events.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Faker.Extensions; 4 | 5 | namespace Faker 6 | { 7 | public static class Events 8 | { 9 | 10 | public static string Activity() 11 | { 12 | return Resources.Events.Activity.Split(Config.Separator).Random(); 13 | } 14 | public static string Season() 15 | { 16 | return Resources.Events.Season.Split(Config.Separator).Random(); 17 | } 18 | 19 | 20 | /// 21 | /// Generate a buzzword-laden catch phrase. 22 | /// Wordlist from http://www.1728.com/buzzword.htm 23 | /// 24 | public static string Name() 25 | { 26 | return String.Join(" ", 27 | new[] 28 | { 29 | Resources.Events.Season.Split(Config.Separator).Random(), 30 | Resources.Events.Activity.Split(Config.Separator).Random(), 31 | }); 32 | } 33 | 34 | 35 | } 36 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/ArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Faker.Extensions 6 | { 7 | public static class ArrayExtensions 8 | { 9 | /// 10 | /// Select a random element from the array. 11 | /// 12 | public static string Random(this string[] list) 13 | { 14 | if (list.Count() == 0) throw new InvalidOperationException("Array must contain at least one item"); 15 | 16 | return list[RandomNumber.Next(0, list.Length)]; 17 | } 18 | 19 | /// 20 | /// Select a random string from the Enumerable list. 21 | /// 22 | public static string Random(this IEnumerable> list) 23 | { 24 | if (list.Count() == 0) throw new InvalidOperationException("Enumerable list must contain at least one item"); 25 | 26 | return list.ElementAt(RandomNumber.Next(0, list.Count())).Invoke(); 27 | } 28 | 29 | /// 30 | /// Select a random string array from the Enumerable list. 31 | /// 32 | public static string[] Random(this IEnumerable> list) 33 | { 34 | if (list.Count() == 0) throw new InvalidOperationException("Enumerable list must contain at least one item"); 35 | 36 | return list.ElementAt(RandomNumber.Next(0, list.Count())).Invoke(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Faker.Extensions 5 | { 6 | public static class EnumerableExtensions 7 | { 8 | public static IEnumerable Times(this int count, Func func) 9 | { 10 | for (var i = 0; i < count; i++) 11 | yield return func.Invoke(i); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Faker/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace Faker.Extensions 4 | { 5 | public static class StringExtensions 6 | { 7 | 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(' '); 8 | 9 | /// 10 | /// Get a string with every occurence of '#' replaced with a random number. 11 | /// 12 | public static string Numerify(this string s) 13 | { 14 | return Regex.Replace(s, "#", new MatchEvaluator((m) => RandomNumber.Next(0, 9).ToString()), RegexOptions.Compiled); 15 | } 16 | 17 | /// 18 | /// Get a string with every '?' replaced with a random character from the alphabet. 19 | /// 20 | public static string Letterify(this string s) 21 | { 22 | return Regex.Replace(s, @"\?", new MatchEvaluator((m) => _alphabet.Random()), RegexOptions.Compiled); 23 | } 24 | 25 | public static string AlphanumericOnly(this string s) 26 | { 27 | return Regex.Replace(s, @"\W", ""); 28 | } 29 | 30 | /// 31 | /// Capitalise the first letter of the given string. 32 | /// 33 | /// 34 | /// 35 | public static string Capitalise(this string s) 36 | { 37 | return Regex.Replace(s, "^[a-z]", new MatchEvaluator(x => x.Value.ToUpperInvariant())); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /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 | public static string Email() 12 | { 13 | return String.Format("{0}@{1}", UserName(), DomainName()); 14 | } 15 | 16 | public static string Email(string name) 17 | { 18 | return String.Format("{0}@{1}", UserName(name), DomainName()); 19 | } 20 | 21 | public static string FreeEmail() 22 | { 23 | return String.Format("{0}@{1}", UserName(), Resources.Internet.FreeMail.Split(Config.Separator).Random()); 24 | } 25 | 26 | public static string UserName() 27 | { 28 | return _userNameFormats.Random(); 29 | } 30 | 31 | public static string UserName(string name) 32 | { 33 | return Regex.Replace(name, @"[^\w]+", new MatchEvaluator(x => new [] { ".", "_" }.Random()), RegexOptions.Compiled).ToLowerInvariant(); 34 | } 35 | 36 | public static string DomainName() 37 | { 38 | return String.Format("{0}.{1}", DomainWord(), DomainSuffix()); 39 | } 40 | 41 | public static string DomainWord() 42 | { 43 | return Company.Name().Split(' ').First().AlphanumericOnly().ToLowerInvariant(); 44 | } 45 | 46 | public static string DomainSuffix() 47 | { 48 | return Resources.Internet.DomainSuffix.Split(Config.Separator).Random(); 49 | } 50 | 51 | public static string IPv4Address() 52 | { 53 | Random random = new Random(); 54 | int min = 2; 55 | int max = 255; 56 | string[] parts = new string[] { 57 | random.Next(min, max).ToString(), 58 | random.Next(min, max).ToString(), 59 | random.Next(min, max).ToString(), 60 | random.Next(min, max).ToString(), 61 | }; 62 | return String.Join(".", parts); 63 | } 64 | 65 | public static string IPv6Address() 66 | { 67 | Random random = new Random(); 68 | int min = 0; 69 | int max = 65536; 70 | string[] parts = new string[] { 71 | random.Next(min, max).ToString("x"), 72 | random.Next(min, max).ToString("x"), 73 | random.Next(min, max).ToString("x"), 74 | random.Next(min, max).ToString("x"), 75 | random.Next(min, max).ToString("x"), 76 | random.Next(min, max).ToString("x"), 77 | random.Next(min, max).ToString("x"), 78 | random.Next(min, max).ToString("x"), 79 | }; 80 | return String.Join(":", parts); 81 | } 82 | 83 | public static string Url() 84 | { 85 | return String.Format("http://{0}/{1}", DomainName(), UserName()); 86 | } 87 | 88 | private static readonly IEnumerable> _userNameFormats = new List> 89 | { 90 | () => Name.First().AlphanumericOnly().ToLowerInvariant(), 91 | () => string.Format("{0}{1}{2}", Name.First().AlphanumericOnly(), 92 | new [] { ".", "_" }.Random(), Name.Last().AlphanumericOnly()).ToLowerInvariant() 93 | }; 94 | } 95 | } -------------------------------------------------------------------------------- /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 | /// 11 | /// Get a random collection of words. 12 | /// 13 | /// Number of words required 14 | /// 15 | public static IEnumerable Words(int count) 16 | { 17 | if (count <= 0) throw new ArgumentException("Count must be greater than zero", "count"); 18 | 19 | return count.Times(x => Resources.Lorem.Words.Split(Config.Separator).Random()); 20 | } 21 | 22 | /// 23 | /// Get the first word of the random word collection. Useful for unit tests. 24 | /// 25 | /// 26 | public static string GetFirstWord() 27 | { 28 | return Resources.Lorem.Words.Split(Config.Separator).First(); 29 | } 30 | 31 | /// 32 | /// Generates a capitalised sentence of random words. 33 | /// 34 | /// Minimum number of words required 35 | /// 36 | public static string Sentence(int minWordCount) 37 | { 38 | if (minWordCount <= 0) throw new ArgumentException("Count must be greater than zero", "minWordCount"); 39 | 40 | return string.Join(" ", Words(minWordCount + RandomNumber.Next(6)).ToArray()).Capitalise() + "."; 41 | } 42 | 43 | public static string Sentence() 44 | { 45 | return Sentence(4); 46 | } 47 | 48 | public static IEnumerable Sentences(int sentenceCount) 49 | { 50 | if (sentenceCount <= 0) throw new ArgumentException("Count must be greater than zero", "sentenceCount"); 51 | 52 | return sentenceCount.Times(x => Sentence()); 53 | } 54 | 55 | public static string Paragraph(int minSentenceCount) 56 | { 57 | if (minSentenceCount <= 0) throw new ArgumentException("Count must be greater than zero", "minSentenceCount"); 58 | 59 | return string.Join(" ", Sentences(minSentenceCount + RandomNumber.Next(3)).ToArray()); 60 | } 61 | 62 | public static string Paragraph() 63 | { 64 | return Paragraph(3); 65 | } 66 | 67 | public static IEnumerable Paragraphs(int paragraphCount) 68 | { 69 | if (paragraphCount <= 0) throw new ArgumentException("Count must be greater than zero", "paragraphCount"); 70 | 71 | return paragraphCount.Times(x => Paragraph()); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /src/Faker/Name.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Faker.Extensions; 5 | 6 | namespace Faker 7 | { 8 | 9 | public enum NameFormats 10 | { 11 | Standard, 12 | WithPrefix, 13 | WithSuffix 14 | } 15 | 16 | public static class Name 17 | { 18 | 19 | /// 20 | /// Create a name using a random format. 21 | /// 22 | public static string FullName() 23 | { 24 | return FullName(_formats.ElementAt(RandomNumber.Next(_formats.Count() - 1))); 25 | } 26 | 27 | /// 28 | /// Create a name using a specified format. 29 | /// 30 | public static string FullName(NameFormats format) 31 | { 32 | return String.Join(" ", _formatMap[format].Invoke()); 33 | } 34 | 35 | public static string First() 36 | { 37 | return Resources.Name.First.Split(Config.Separator).Random().Trim(); 38 | } 39 | 40 | public static string Last() 41 | { 42 | return Resources.Name.Last.Split(Config.Separator).Random().Trim(); 43 | } 44 | 45 | public static string Prefix() 46 | { 47 | return Resources.Name.Prefix.Split(Config.Separator).Random(); 48 | } 49 | 50 | public static string Suffix() 51 | { 52 | return Resources.Name.Suffix.Split(Config.Separator).Random(); 53 | } 54 | 55 | #region Format Mappings 56 | private static readonly IEnumerable _formats = new List 57 | { 58 | NameFormats.WithPrefix, NameFormats.WithSuffix, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard, NameFormats.Standard 59 | }; 60 | private static readonly IDictionary> _formatMap = new Dictionary> 61 | { 62 | { NameFormats.Standard, () => new [] { First(), Last() } }, 63 | { NameFormats.WithPrefix, () => new [] { Prefix(), First(), Last() } }, 64 | { NameFormats.WithSuffix, () => new [] { First(), Last(), Suffix() } } 65 | }; 66 | #endregion 67 | } 68 | } -------------------------------------------------------------------------------- /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).Random().Trim().Numerify(); 10 | } 11 | 12 | /// 13 | /// Allows number to be overridden with any format e.g. 01## ### #### 14 | /// 15 | public static string Number(string pattern) 16 | { 17 | return pattern.Trim().Numerify(); 18 | } 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /src/Faker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Faker")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Faker")] 12 | [assembly: AssemblyCopyright("Copyright © 2012")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("6e293261-e726-44bd-bffe-f5c454764512")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/Faker/RandomNumber.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Faker 4 | { 5 | /// 6 | /// Provide access to random number geenrator. 7 | /// 8 | public static class RandomNumber 9 | { 10 | private static Random _rnd = new Random(); 11 | 12 | public static void ResetSeed(int seed) 13 | { 14 | _rnd = new Random(seed); 15 | } 16 | 17 | public static int Next() 18 | { 19 | return _rnd.Next(); 20 | } 21 | 22 | public static int Next(int max) 23 | { 24 | return _rnd.Next(max); 25 | } 26 | 27 | public static int Next(int min, int max) 28 | { 29 | return _rnd.Next(min, max); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Faker/Resources/Address.pt-BR.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/src/Faker/Resources/Address.pt-BR.Designer.cs -------------------------------------------------------------------------------- /src/Faker/Resources/Events.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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Events { 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 Events() { 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.Events", typeof(Events).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 swim;run;trisport;fun;fitness;zumba;aerobics;yoga;dance;spin class;pumpkin carving;badminton;soccer;hockey;basketball;football;golf. 65 | /// 66 | internal static string Activity { 67 | get { 68 | return ResourceManager.GetString("Activity", resourceCulture); 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized string similar to spring;summer;fall;winter. 74 | /// 75 | internal static string Season { 76 | get { 77 | return ResourceManager.GetString("Season", resourceCulture); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/Faker/Resources/Internet.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 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", "4.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 | } 82 | -------------------------------------------------------------------------------- /src/Faker/Resources/Internet.pt-BR.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/src/Faker/Resources/Internet.pt-BR.Designer.cs -------------------------------------------------------------------------------- /src/Faker/Resources/Lorem.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 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", "4.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/Name.pt-BR.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/src/Faker/Resources/Name.pt-BR.Designer.cs -------------------------------------------------------------------------------- /src/Faker/Resources/Phone.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 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", "4.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.pt-BR.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashdotdash/faker-cs/2c9f378b0d17ce539767fd27db3c005898eb0a61/src/Faker/Resources/Phone.pt-BR.Designer.cs -------------------------------------------------------------------------------- /tests/Faker.Tests/AddressFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text.RegularExpressions; 3 | using System.Threading; 4 | using NUnit.Framework; 5 | 6 | namespace Faker.Tests 7 | { 8 | [TestFixture] 9 | public class AddressFixture 10 | { 11 | [TestFixtureSetUp] 12 | public void Setup() 13 | { 14 | Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); 15 | Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); 16 | } 17 | 18 | [Test] 19 | public void Should_Get_Street_Address() 20 | { 21 | var address = Address.StreetAddress(); 22 | Assert.IsTrue(Regex.IsMatch(address, "^[0-9]{3,5} [A-Z][a-z]+ [A-Z][a-z]+$")); 23 | } 24 | 25 | [Test] 26 | public void Should_Get_Street_Address_With_Secondary_Address() 27 | { 28 | var address = Address.StreetAddress(true); 29 | Assert.IsTrue(Regex.IsMatch(address, @"^[0-9]{3,5} [A-Z][a-z]+ [A-Z][a-z]+ [A-Z][a-z]+\.? [0-9]{3}$")); 30 | } 31 | 32 | [Test] 33 | public void Should_Get_Random_Location() 34 | { 35 | var latlng = Address.LatLng(); 36 | Assert.IsTrue(latlng.Lat >= -85); 37 | Assert.IsTrue(latlng.Lat <= 85); 38 | 39 | Assert.IsTrue(latlng.Lng >= -180); 40 | Assert.IsTrue(latlng.Lng <= 180); 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/Faker.Tests/CompanyFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using System.Text.RegularExpressions; 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 | 17 | // Name should match one of the given formats 18 | Assert.IsTrue(new List> 19 | { 20 | () => Regex.IsMatch(name, @"\w+ \w+"), 21 | () => Regex.IsMatch(name, @"\w+-\w+"), 22 | () => Regex.IsMatch(name, @"\w+, \w+ and \w+") 23 | }.Any(x => x.Invoke())); 24 | } 25 | 26 | [Test] 27 | public void Should_Generate_Catchphrase() 28 | { 29 | var catchPhrase = Company.CatchPhrase(); 30 | Assert.IsTrue(Regex.IsMatch(catchPhrase, @"[\w\-]+ [\w\-]+ [\w\-]+")); 31 | } 32 | 33 | [Test] 34 | public void Should_Generate_Bs() 35 | { 36 | var bs = Company.BS(); 37 | Assert.IsTrue(Regex.IsMatch(bs, @"[\w\-]+ [\w\-]+ [\w\-]+")); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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* according to 9 | /// http://msdn.microsoft.com/en-us/library/ms172469(v=VS.85).aspx 10 | /// That's why 11 | /// (1) we take en-US as default and 12 | /// (2) require de-DE to have an 'extra word' at the beginning of the list within the resx file. 13 | /// In other words: This 'extra word' must differ from the first word in the default (en-US) resx file. 14 | /// 15 | /// And no, we can't access Resource files from another dll directly. 16 | /// 17 | [TestFixture] 18 | public class CultureInfoFixture 19 | { 20 | private const string DefaultCultureInfoString = "en-US"; 21 | 22 | #region Setup/TearDown 23 | [SetUp] 24 | public void Setup() 25 | { 26 | SetCultureToDefault(); 27 | } 28 | 29 | [TearDown] 30 | public void TearDown() 31 | { 32 | SetCultureToDefault(); 33 | } 34 | #endregion 35 | 36 | #region TESTS 37 | [Test] 38 | public void Should_Be_Default() 39 | { 40 | var expected = GetFirstDefaultWord(); 41 | var actual = Lorem.GetFirstWord(); 42 | Assert.AreEqual(expected, actual); 43 | } 44 | 45 | [Test] 46 | public void Should_Be_German() 47 | { 48 | var expected = GetFirstGermanWord(); 49 | var actual = Lorem.GetFirstWord(); 50 | Assert.AreNotEqual(expected, actual); 51 | } 52 | #endregion 53 | 54 | #region Helper 55 | private void SetCultureToDefault() 56 | { 57 | SetCurrentCulture(DefaultCultureInfoString); 58 | } 59 | 60 | private void SetCurrentCulture(string cultureInfoString) 61 | { 62 | Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureInfoString); 63 | Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureInfoString); 64 | } 65 | 66 | private string GetFirstDefaultWord() 67 | { 68 | return Lorem.GetFirstWord(); 69 | } 70 | 71 | private string GetFirstGermanWord() 72 | { 73 | SetCurrentCulture("de-DE"); 74 | var result = Lorem.GetFirstWord(); 75 | SetCultureToDefault(); 76 | return result; 77 | } 78 | #endregion 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /tests/Faker.Tests/EventsFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace Faker.Tests 8 | { 9 | [TestFixture] 10 | public class EventsFixture 11 | { 12 | [Test] 13 | public void Should_Generate_Name() 14 | { 15 | var name = Events.Name(); 16 | 17 | // Name should match one of the given formats 18 | Assert.IsTrue(new List> 19 | { 20 | () => Regex.IsMatch(name, @"\w+ \w+"), 21 | () => Regex.IsMatch(name, @"\w+-\w+"), 22 | }.Any(x => x.Invoke())); 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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().Count()); 32 | } 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 | } 18 | -------------------------------------------------------------------------------- /tests/Faker.Tests/Extensions/StringExtensionsFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Faker.Extensions; 3 | using NUnit.Framework; 4 | using System.Text.RegularExpressions; 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().Count() > 1); 25 | Assert.AreEqual(10, number.Length); 26 | } 27 | 28 | [Test] 29 | public void Should_Replace_Question_Mark_With_Random_Letter() 30 | { 31 | var word = "?".Letterify(); 32 | Assert.IsTrue(Regex.IsMatch(word, "^[a-z]$")); 33 | Assert.AreEqual(1, word.Length); 34 | } 35 | 36 | [Test] 37 | public void Should_Replace_Multiple_Question_Marks_With_Different_Random_Letters() 38 | { 39 | var word = "??????????".Letterify(); 40 | Assert.IsTrue(Regex.IsMatch(word, "^[a-z]+$")); 41 | Assert.IsTrue(word.Distinct().Count() > 1); 42 | Assert.AreEqual(10, word.Length); 43 | } 44 | 45 | [Test] 46 | public void Should_Replace_Both_Hash_And_Question_Marks() 47 | { 48 | var word = "#?#?".Letterify().Numerify(); 49 | Assert.IsTrue(Regex.IsMatch(word, "^[0-9][a-z][0-9][a-z]$")); 50 | Assert.AreEqual(4, word.Length); 51 | } 52 | 53 | [Test] 54 | public void Should_Capitalise_First_Lowercase_Letter() 55 | { 56 | Assert.AreEqual("The quick brown fox", "the quick brown fox".Capitalise()); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tests/Faker.Tests/InternetFixture.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | using NUnit.Framework; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class InternetFixture 8 | { 9 | [Test] 10 | public void Should_Create_Email_Address() 11 | { 12 | var email = Internet.Email(); 13 | Assert.IsTrue(Regex.IsMatch(email, @".+@.+\.\w+")); 14 | } 15 | 16 | [Test] 17 | public void Should_Create_Email_Address_From_Given_Name() 18 | { 19 | var email = Internet.Email("Bob Smith"); 20 | Assert.IsTrue(Regex.IsMatch(email, @"bob[_\.]smith@.+\.\w+")); 21 | } 22 | 23 | [Test] 24 | public void Should_Create_Free_Email() 25 | { 26 | var email = Internet.FreeEmail(); 27 | Assert.IsTrue(Regex.IsMatch(email, @".+@(gmail|hotmail|yahoo)\.com")); 28 | } 29 | 30 | [Test] 31 | public void Should_Create_User_Name() 32 | { 33 | var username = Internet.UserName(); 34 | Assert.IsTrue(Regex.IsMatch(username, @"[a-z]+((_|\.)[a-z]+)?")); 35 | } 36 | 37 | [Test] 38 | public void Should_Create_User_Name_From_Given_Name() 39 | { 40 | var username = Internet.UserName("Bob Smith"); 41 | Assert.IsTrue(Regex.IsMatch(username, @"bob[_\.]smith")); 42 | } 43 | 44 | [Test] 45 | public void Should_Get_Domain_Name() 46 | { 47 | var domain = Internet.DomainName(); 48 | Assert.IsTrue(Regex.IsMatch(domain, @"\w+\.\w+")); 49 | } 50 | 51 | [Test] 52 | public void Should_Get_Domain_Word() 53 | { 54 | var word = Internet.DomainWord(); 55 | Assert.IsTrue(Regex.IsMatch(word, @"^\w+$")); 56 | } 57 | 58 | [Test] 59 | public void Should_Get_Domain_Suffix() 60 | { 61 | var suffix = Internet.DomainSuffix(); 62 | Assert.IsTrue(Regex.IsMatch(suffix, @"^\w+(\.\w+)?")); 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /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 NUnit.Framework; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class NameFixture 8 | { 9 | [Test] 10 | public void Should_Get_FullName() 11 | { 12 | var name = Name.FullName(); 13 | Assert.IsTrue(Regex.IsMatch(name, @"^(\w+\.? ?){2,3}$")); 14 | } 15 | 16 | [Test] 17 | public void Should_Get_FullName_With_Standard_Format() 18 | { 19 | var name = Name.FullName(NameFormats.Standard); 20 | Assert.IsTrue(Regex.IsMatch(name, @"^\w+\.? \w+\.?$")); 21 | } 22 | 23 | [Test] 24 | public void Should_Get_Prefix() 25 | { 26 | var prefix = Name.Prefix(); 27 | Assert.IsTrue(Regex.IsMatch(prefix, @"^[A-Z][a-z]+\.?$")); 28 | } 29 | 30 | [Test] 31 | public void Should_Get_Suffix() 32 | { 33 | var suffix = Name.Suffix(); 34 | Assert.IsTrue(Regex.IsMatch(suffix, @"^[A-Z][A-Za-z]*\.?$")); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/Faker.Tests/PhoneFixture.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace Faker.Tests 5 | { 6 | [TestFixture] 7 | public class PhoneFixture 8 | { 9 | [Test] 10 | public void Should_Generate_Phone_Number() 11 | { 12 | var number = Phone.Number(); 13 | Assert.IsTrue(Regex.IsMatch(number, @"[0-9 x\-\(\)\.]+")); 14 | } 15 | 16 | [TestCase("01## ### ####", @"01[0-9][0-9]\s[0-9][0-9][0-9]\s[0-9][0-9][0-9][0-9]")] 17 | [TestCase("###-###-####", @"[0-9][0-9][0-9]\-[0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9]")] 18 | [TestCase("### ### ####", @"[0-9][0-9][0-9]\s[0-9][0-9][0-9]\s[0-9][0-9][0-9][0-9]")] 19 | public void Should_Generate_Phone_Number_Based_On_Pattern(string pattern, string regexMatchPattern) 20 | { 21 | var number = Phone.Number(pattern); 22 | Assert.IsTrue(Regex.IsMatch(number, regexMatchPattern)); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /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/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------