File tree Expand file tree Collapse file tree 13 files changed +144
-28
lines changed Expand file tree Collapse file tree 13 files changed +144
-28
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ namespace ObjectFiller.Test
22{
33 using Microsoft . VisualStudio . TestTools . UnitTesting ;
44
5- using Tynamix . ObjectFiller . Plugins . String ;
5+ using Tynamix . ObjectFiller ;
66
77 [ TestClass ]
88 public class CityNamesPluginTest
99 {
1010 [ TestMethod ]
1111 public void RandomNameIsReturned ( )
1212 {
13- var sut = new CityNames ( ) ;
13+ var sut = new CityName ( ) ;
1414 var value = sut . GetValue ( ) ;
1515
1616 Assert . IsFalse ( string . IsNullOrEmpty ( value ) ) ;
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 ;
6+
7+ [ TestClass ]
8+ public class CountryNamesPlugin
9+ {
10+ [ TestMethod ]
11+ public void RandomNameIsReturned ( )
12+ {
13+ var sut = new CountryName ( ) ;
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 4646 </ItemGroup >
4747 <ItemGroup >
4848 <Compile Include =" AddressFillingTest.cs" />
49+ <Compile Include =" CountryNamesPlugin.cs" />
4950 <Compile Include =" CityNamesPluginTest.cs" />
5051 <Compile Include =" CreateInstanceTest.cs" />
5152 <Compile Include =" DefaultDatatypeMappingsTest.cs" />
Original file line number Diff line number Diff line change 11namespace ObjectFiller . Test
22{
33 using System ;
4+ using System . Linq ;
45
56 using Microsoft . VisualStudio . TestTools . UnitTesting ;
67
Original file line number Diff line number Diff line change 11using Microsoft . VisualStudio . TestTools . UnitTesting ;
2- using Tynamix . ObjectFiller . Plugins . String ;
32
43namespace ObjectFiller . Test
54{
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" />
39+ <Compile Include =" Plugins\String\CountryName .cs" />
4040 <Compile Include =" Plugins\String\EmailAddresses.cs" />
41+ <Compile Include =" Plugins\String\CityName.cs" />
4142 <Compile Include =" Plugins\String\StreetName.cs" />
4243 <Compile Include =" Plugins\String\Lipsum.cs" />
4344 <Compile Include =" HashStack.cs" />
Original file line number Diff line number Diff line change 1+ // --------------------------------------------------------------------------------------------------------------------
2+ // <copyright file="CityName.cs" company="Tynamix">
3+ // © 2015 by Hendrik Lösch and Roman Köhler
4+ // </copyright>
5+ // <summary>
6+ // Generate city name for type <see cref="string" />
7+ // </summary>
8+ // --------------------------------------------------------------------------------------------------------------------
9+
10+ namespace Tynamix . ObjectFiller
11+ {
12+ using System . Collections . Generic ;
13+ using System . Linq ;
14+
15+ using Tynamix . ObjectFiller . Properties ;
16+
17+ /// <summary>
18+ /// Generate city names for type <see cref="string"/>. The Top 1000 cities with the most population will be used
19+ /// </summary>
20+ public class CityName : IRandomizerPlugin < string >
21+ {
22+ /// <summary>
23+ /// The names.
24+ /// </summary>
25+ protected static readonly List < string > AllCityNames ;
26+
27+ /// <summary>
28+ /// Initializes static members of the <see cref="CityName"/> class.
29+ /// </summary>
30+ static CityName ( )
31+ {
32+ AllCityNames = Resources . cityNames . Split ( ';' ) . ToList ( ) ;
33+ }
34+
35+ /// <summary>
36+ /// Gets random data for type <see cref="T"/>
37+ /// </summary>
38+ /// <returns>Random data for type <see cref="T"/></returns>
39+ public string GetValue ( )
40+ {
41+ var index = Random . Next ( AllCityNames . Count - 1 ) ;
42+ return AllCityNames [ index ] ;
43+ }
44+ }
45+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // --------------------------------------------------------------------------------------------------------------------
2+ // <copyright file="CountryName.cs" company="Tynamix">
3+ // © 2015 by Hendrik Lösch and Roman Köhler
4+ // </copyright>
5+ // <summary>
6+ // Generate country names for type <see cref="string" />
7+ // </summary>
8+ // --------------------------------------------------------------------------------------------------------------------
9+
10+ namespace Tynamix . ObjectFiller
11+ {
12+ using System . Collections . Generic ;
13+ using System . Linq ;
14+
15+ using Tynamix . ObjectFiller . Properties ;
16+
17+ /// <summary>
18+ /// Generate country names for type <see cref="string"/>
19+ /// </summary>
20+ public class CountryName : IRandomizerPlugin < string >
21+ {
22+ /// <summary>
23+ /// The names.
24+ /// </summary>
25+ protected static readonly List < string > AllCountryNames ;
26+
27+ /// <summary>
28+ /// Initializes static members of the <see cref="CountryName"/> class.
29+ /// </summary>
30+ static CountryName ( )
31+ {
32+ AllCountryNames = Resources . countryNames . Split ( ';' ) . ToList ( ) ;
33+ }
34+
35+ /// <summary>
36+ /// Gets random data for type <see cref="T"/>
37+ /// </summary>
38+ /// <returns>Random data for type <see cref="T"/></returns>
39+ public string GetValue ( )
40+ {
41+ var index = Random . Next ( AllCountryNames . Count - 1 ) ;
42+ return AllCountryNames [ index ] ;
43+ }
44+ }
45+ }
Original file line number Diff line number Diff line change @@ -11,14 +11,17 @@ public enum LipsumFlavor
1111 /// Standard Lorem Ipsum words.
1212 /// </summary>
1313 LoremIpsum ,
14+
1415 /// <summary>
1516 /// Words from Child Harold by Lord Byron.
1617 /// </summary>
1718 ChildHarold ,
19+
1820 /// <summary>
1921 /// Words from In der Fremde by Heinrich Hiene (German)
2022 /// </summary>
2123 InDerFremde ,
24+
2225 /// <summary>
2326 /// Words from Le Masque by Arthur Rembaud (French)
2427 /// </summary>
You can’t perform that action at this time.
0 commit comments