public void WhenUsingChildListBuilderWithoutModifier_ThenAListOfDefaultChildrenObjectsGetCreated() { var parent = new ParentBuilder() .WithChildrenBuilder(4) .Build(); parent.Children.Count.ShouldBe(4); }
public void WhenUsingChildBuilderIncludingModifier_ThenTheModifierGetsApplied() { const int number = 2; var parent = new ParentBuilder() .WithChildBuilder(b => b.WithANumber(number)) .Build(); parent.Child.Number.ShouldBe(number); }
public void WhenUsingChildListBuilderIncludingModifier_ThenTheModifierGetsApplied() { const int number = 2; var parent = new ParentBuilder() .WithChildrenBuilder(4, b => b.All().WithANumber(number)) .Build(); parent.Children.Count.ShouldBe(4); parent.Children.ForEach((x) => x.Number.ShouldBe(2)); }
public void WhenNotUsingChildBuilder_ThenTheAnonymousValueFixtureIsNotReused() { var parent = new ParentBuilder().Build(); parent.ParentEnum.ShouldBe(parent.Child.ChildEnum); }