File tree Expand file tree Collapse file tree 6 files changed +2755
-0
lines changed Expand file tree Collapse file tree 6 files changed +2755
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments