예제 #1
0
        public void AddMany_With_Instances_Will_Add_Item_Builders_With_These_Instances_To_Builders()
        {
            var parentBuilder = new BuilderForTesting <ExampleClass>();
            var t             = new CollectionBuilder <ExampleChildClass, ExampleChildClassBuilder>(parentBuilder);
            var c             = new[] { new ExampleChildClass(), new ExampleChildClass(), new ExampleChildClass() };

            t.AddMany(c);

            t.Builders.Count.Should().Be(3);
            t.CreateAll().Should().Contain(c);
        }
예제 #2
0
        public void AddOne_With_Instance_Will_Add_Item_Builder_With_That_Instance_To_Builders()
        {
            var parentBuilder = new BuilderForTesting <ExampleClass>();
            var t             = new CollectionBuilder <ExampleChildClass, ExampleChildClassBuilder>(parentBuilder);
            var c             = new ExampleChildClass();

            t.AddOne(c);

            t.Builders.Count.Should().Be(1);
            t.CreateAll().Should().OnlyContain(x => x == c);
        }