public void FakerConfig_TestNumberOfSmallLetters() { DictionaryOfGenerators dict = new DictionaryOfGenerators(); var config = new FakerConfig(dict); config.Add <TestClass1, string, StringConfigGenerator>(TestClass1 => TestClass1.str); Faker.Faker faker = new Faker.Faker(dict); TestClass1 obj = faker.Create <TestClass1>(); var a = from b in obj.str.ToLower() where b >= 'a' && b <= 'z' select b; Assert.AreEqual(obj.str.Length, a.Count()); }
public void Faker_TestClassWithFakerConfig() { DictionaryOfGenerators dict = new DictionaryOfGenerators(); var config = new FakerConfig(dict); config.Add <TestClass1, string, StringConfigGenerator>(TestClass1 => TestClass1.str); Faker.Faker faker = new Faker.Faker(dict); TestClass1 obj = faker.Create <TestClass1>(); var a = from b in obj.str where b >= '0' && b <= '9' select b; Assert.AreEqual(0, a.Count()); }
public FakerConfig(DictionaryOfGenerators dictionaryOfGenerators) { _generator = dictionaryOfGenerators; dictionary = new Dictionary <Type, Tuple <string, IGenerator> >(); }
public Faker(DictionaryOfGenerators generator) { _generator = generator; f = this; }