public void SetupsCanBeCreatedWithFactoryMethod() { var childSetup = FillerSetup.Create <Child>().OnProperty(x => x.IntValue).Use(42).Result; var child = Randomizer <Child> .Create(childSetup); Assert.AreEqual(42, child.IntValue); }
public void SetupsCanBeCreatedWithFactoryMethodBasedOnExistingSetupManager() { var childSetup = FillerSetup.Create <Child>().OnProperty(x => x.IntValue).Use(42).Result; childSetup = FillerSetup.Create <Child>(childSetup).OnProperty(x => x.StringValue).Use("Juchu").Result; var child = Randomizer <Child> .Create(childSetup); Assert.AreEqual(42, child.IntValue); Assert.AreEqual("Juchu", child.StringValue); }
public void RandomizerCreatesAListOfItemBasedOnASetup() { int amount = 5; var setup = FillerSetup.Create <Address>().OnType <int>().Use(1).Result; IEnumerable <Address> result = Randomizer <Address> .Create(setup, amount); Assert.Equal(amount, result.Count()); Assert.True(result.Count(x => x.HouseNumber == 1) == amount); }