Skip to content

Commit 5b33624

Browse files
committed
Added plugin for city and street names.
1 parent c7d9341 commit 5b33624

File tree

6 files changed

+2755
-0
lines changed

6 files changed

+2755
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace ObjectFiller.Test
2+
{
3+
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
5+
using Tynamix.ObjectFiller.Plugins.String;
6+
7+
[TestClass]
8+
public class CityNamesPluginTest
9+
{
10+
[TestMethod]
11+
public void RandomNameIsReturned()
12+
{
13+
var sut = new CityNames();
14+
var value = sut.GetValue();
15+
16+
Assert.IsFalse(string.IsNullOrEmpty(value));
17+
}
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Tynamix.ObjectFiller.Plugins.String;
3+
4+
namespace ObjectFiller.Test
5+
{
6+
[TestClass]
7+
public class GermanStreetNamesPluginTest
8+
{
9+
[TestMethod]
10+
public void RandomNameIsReturned()
11+
{
12+
var sut = new GermanStreetNames();
13+
var value = sut.GetValue();
14+
15+
Assert.IsFalse(string.IsNullOrEmpty(value));
16+
}
17+
}
18+
}

ObjectFiller.Test/ObjectFiller.Test.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@
4646
</ItemGroup>
4747
<ItemGroup>
4848
<Compile Include="AddressFillingTest.cs" />
49+
<Compile Include="CityNamesPluginTest.cs" />
4950
<Compile Include="CreateInstanceTest.cs" />
5051
<Compile Include="DefaultDatatypeMappingsTest.cs" />
5152
<Compile Include="EnumTest.cs" />
53+
<Compile Include="GermanStreetNamesPluginTest.cs" />
5254
<Compile Include="HashStackTests.cs" />
5355
<Compile Include="LibraryFillingTest.cs" />
5456
<Compile Include="ListFillingTest.cs" />

ObjectFiller/ObjectFiller.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
<Reference Include="System.Core" />
3737
</ItemGroup>
3838
<ItemGroup>
39+
<Compile Include="Plugins\String\CityNames.cs" />
40+
<Compile Include="Plugins\String\GermanStreetNames.cs" />
3941
<Compile Include="Plugins\String\Lipsum.cs" />
4042
<Compile Include="HashStack.cs" />
4143
<Compile Include="Setup\FillerSetup.cs" />
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace Tynamix.ObjectFiller.Plugins.String
2+
{
3+
using System.Collections.Generic;
4+
5+
public class CityNames : IRandomizerPlugin<string>
6+
{
7+
protected readonly List<string> _names = new List<string>
8+
{
9+
"Lodon",
10+
"Paris",
11+
"Dresden",
12+
"Berlin",
13+
"Rom",
14+
"New York"
15+
};
16+
17+
public string GetValue()
18+
{
19+
var index = Random.Next(_names.Count - 1);
20+
return _names[index];
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)