예제 #1
0
        public void WhenUsingChildListBuilderWithoutModifier_ThenAListOfDefaultChildrenObjectsGetCreated()
        {
            var parent = new ParentBuilder()
                         .WithChildrenBuilder(4)
                         .Build();

            parent.Children.Count.ShouldBe(4);
        }
예제 #2
0
        public void WhenUsingChildBuilderIncludingModifier_ThenTheModifierGetsApplied()
        {
            const int number = 2;
            var       parent = new ParentBuilder()
                               .WithChildBuilder(b => b.WithANumber(number))
                               .Build();

            parent.Child.Number.ShouldBe(number);
        }
예제 #3
0
        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));
        }
예제 #4
0
        public void WhenNotUsingChildBuilder_ThenTheAnonymousValueFixtureIsNotReused()
        {
            var parent = new ParentBuilder().Build();

            parent.ParentEnum.ShouldBe(parent.Child.ChildEnum);
        }