Skip to content

Commit

Permalink
added more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Nov 8, 2018
1 parent 60a14f1 commit a756457
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions src/ConsoleAppClassic/MainTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,51 @@ public static class MainTest
{
public static void Run()
{
var randomizerTextPattern = RandomizerFactory.GetRandomizer(new FieldOptionsTextPattern { Pattern = "\\xLLnn_**ss\\x" });
string textPattern = randomizerTextPattern.Generate();
Write(randomizerTextPattern, textPattern);
var randomizerCity = RandomizerFactory.GetRandomizer(new FieldOptionsCity());
string city = randomizerCity.Generate();
Write(randomizerCity, city);

var randomizerText = RandomizerFactory.GetRandomizer(new FieldOptionsText { UseNumber = false, UseSpecial = false });
string text = randomizerText.Generate();
Write(randomizerText, text);
var randomizerCountry = RandomizerFactory.GetRandomizer(new FieldOptionsCountry());
string country = randomizerCountry.Generate();
Write(randomizerCountry, country);

var randomizerFirstName = RandomizerFactory.GetRandomizer(new FieldOptionsFirstName());
Write(randomizerFirstName, randomizerFirstName.Generate());
var randomizerDateTime = RandomizerFactory.GetRandomizer(new FieldOptionsDateTime { DateFrom = DateTime.Today.AddDays(-1888) });
DateTime? date = randomizerDateTime.Generate();
Write(randomizerDateTime, date);

var randomizerGuid = RandomizerFactory.GetRandomizer(new FieldOptionsGuid());
Write(randomizerGuid, randomizerGuid.Generate());
Write(randomizerGuid, randomizerGuid.GenerateAsString());
var randomizerFirstName = RandomizerFactory.GetRandomizer(new FieldOptionsFirstName());
string firstname = randomizerFirstName.Generate();
Write(randomizerFirstName, firstname);

var randomizerInteger = RandomizerFactory.GetRandomizer(new FieldOptionsInteger());
Write(randomizerInteger, randomizerInteger.Generate());
int? integer = randomizerInteger.Generate();
Write(randomizerInteger, integer);

var randomizerDateTime = RandomizerFactory.GetRandomizer(new FieldOptionsDateTime { DateFrom = DateTime.Today.AddDays(-1888) });
Write(randomizerDateTime, randomizerDateTime.Generate());
var randomizerGuid = RandomizerFactory.GetRandomizer(new FieldOptionsGuid());
Guid? guid = randomizerGuid.Generate();
Write(randomizerGuid, guid);
string guidAsString = randomizerGuid.GenerateAsString();
Write(randomizerGuid, guidAsString);

var randomizerStringList = RandomizerFactory.GetRandomizer(new FieldOptionsStringList { Values = new[] { "1", "b" }.ToList() });
Write(randomizerStringList, randomizerStringList.Generate());
string stringListValue = randomizerStringList.Generate();
Write(randomizerStringList, stringListValue);

var randomizerTextWords = RandomizerFactory.GetRandomizer(new FieldOptionsTextWords { Min = 10, Max = 10 });
Write(randomizerTextWords, randomizerTextWords.Generate());
var randomizerText = RandomizerFactory.GetRandomizer(new FieldOptionsText { UseNumber = false, UseSpecial = false });
string text = randomizerText.Generate();
Write(randomizerText, text);

var randomizerTextLipsum = RandomizerFactory.GetRandomizer(new FieldOptionsTextLipsum { Paragraphs = 1 });
Write(randomizerTextLipsum, randomizerTextLipsum.Generate());
string lipsum = randomizerTextLipsum.Generate();
Write(randomizerTextLipsum, lipsum);

var randomizerTextPattern = RandomizerFactory.GetRandomizer(new FieldOptionsTextPattern { Pattern = "\\xLLnn_**ss\\x" });
string textPattern = randomizerTextPattern.Generate();
Write(randomizerTextPattern, textPattern);

var randomizerTextWords = RandomizerFactory.GetRandomizer(new FieldOptionsTextWords { Min = 10, Max = 10 });
string words = randomizerTextWords.Generate();
Write(randomizerTextWords, words);
}

private static void Write<T>(object randomizer, T value)
Expand Down

0 comments on commit a756457

Please sign in to comment.