Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ObjectFiller.Test/CityNamesPluginTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ namespace ObjectFiller.Test
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Tynamix.ObjectFiller.Plugins.String;
using Tynamix.ObjectFiller;

[TestClass]
public class CityNamesPluginTest
{
[TestMethod]
public void RandomNameIsReturned()
{
var sut = new CityNames();
var sut = new CityName();
var value = sut.GetValue();

Assert.IsFalse(string.IsNullOrEmpty(value));
Expand Down
19 changes: 19 additions & 0 deletions ObjectFiller.Test/CountryNamesPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace ObjectFiller.Test
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Tynamix.ObjectFiller;

[TestClass]
public class CountryNamesPlugin
{
[TestMethod]
public void RandomNameIsReturned()
{
var sut = new CountryName();
var value = sut.GetValue();

Assert.IsFalse(string.IsNullOrEmpty(value));
}
}
}
1 change: 1 addition & 0 deletions ObjectFiller.Test/ObjectFiller.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AddressFillingTest.cs" />
<Compile Include="CountryNamesPlugin.cs" />
<Compile Include="CityNamesPluginTest.cs" />
<Compile Include="CreateInstanceTest.cs" />
<Compile Include="DefaultDatatypeMappingsTest.cs" />
Expand Down
1 change: 1 addition & 0 deletions ObjectFiller.Test/RandomizerTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace ObjectFiller.Test
{
using System;
using System.Linq;

using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
1 change: 0 additions & 1 deletion ObjectFiller.Test/StreetNamesPluginTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Tynamix.ObjectFiller.Plugins.String;

namespace ObjectFiller.Test
{
Expand Down
3 changes: 2 additions & 1 deletion ObjectFiller/ObjectFiller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Plugins\String\CityNames.cs" />
<Compile Include="Plugins\String\CountryName.cs" />
<Compile Include="Plugins\String\EmailAddresses.cs" />
<Compile Include="Plugins\String\CityName.cs" />
<Compile Include="Plugins\String\StreetName.cs" />
<Compile Include="Plugins\String\Lipsum.cs" />
<Compile Include="HashStack.cs" />
Expand Down
45 changes: 45 additions & 0 deletions ObjectFiller/Plugins/String/CityName.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CityName.cs" company="Tynamix">
// � 2015 by Hendrik L�sch and Roman K�hler
// </copyright>
// <summary>
// Generate city name for type <see cref="string" />
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Tynamix.ObjectFiller
{
using System.Collections.Generic;
using System.Linq;

using Tynamix.ObjectFiller.Properties;

/// <summary>
/// Generate city names for type <see cref="string"/>. The Top 1000 cities with the most population will be used
/// </summary>
public class CityName : IRandomizerPlugin<string>
{
/// <summary>
/// The names.
/// </summary>
protected static readonly List<string> AllCityNames;

/// <summary>
/// Initializes static members of the <see cref="CityName"/> class.
/// </summary>
static CityName()
{
AllCityNames = Resources.cityNames.Split(';').ToList();
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
public string GetValue()
{
var index = Random.Next(AllCityNames.Count - 1);
return AllCityNames[index];
}
}
}
23 changes: 0 additions & 23 deletions ObjectFiller/Plugins/String/CityNames.cs

This file was deleted.

45 changes: 45 additions & 0 deletions ObjectFiller/Plugins/String/CountryName.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CountryName.cs" company="Tynamix">
// � 2015 by Hendrik L�sch and Roman K�hler
// </copyright>
// <summary>
// Generate country names for type <see cref="string" />
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Tynamix.ObjectFiller
{
using System.Collections.Generic;
using System.Linq;

using Tynamix.ObjectFiller.Properties;

/// <summary>
/// Generate country names for type <see cref="string"/>
/// </summary>
public class CountryName : IRandomizerPlugin<string>
{
/// <summary>
/// The names.
/// </summary>
protected static readonly List<string> AllCountryNames;

/// <summary>
/// Initializes static members of the <see cref="CountryName"/> class.
/// </summary>
static CountryName()
{
AllCountryNames = Resources.countryNames.Split(';').ToList();
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
public string GetValue()
{
var index = Random.Next(AllCountryNames.Count - 1);
return AllCountryNames[index];
}
}
}
3 changes: 3 additions & 0 deletions ObjectFiller/Plugins/String/Lipsum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ public enum LipsumFlavor
/// Standard Lorem Ipsum words.
/// </summary>
LoremIpsum,

/// <summary>
/// Words from Child Harold by Lord Byron.
/// </summary>
ChildHarold,

/// <summary>
/// Words from In der Fremde by Heinrich Hiene (German)
/// </summary>
InDerFremde,

/// <summary>
/// Words from Le Masque by Arthur Rembaud (French)
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions ObjectFiller/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading