예제 #1
0
        public void Adds_created_and_initialized_child_when_adding_with_property_collector_to_enumerable_collection()
        {
            dynamic collector = new PropertyValueCollector();

            SomeClass actual = _builder
                .EnumerableObject(collector.SomeString("string").SomeDouble(1.23))
                .Build();

            var actualChild = actual.EnumerableObjects.FirstOrDefault();

            Assert.AreEqual(1, actual.EnumerableObjects.Count());
            Assert.AreEqual("string", actualChild.SomeString);
            Assert.AreEqual(1.23, actualChild.SomeDouble);
        }
예제 #2
0
        public void Adds_child_with_properties_set_on_added_instance_when_adding_plural_s_results_in_collection_name()
        {
            dynamic collector = new PropertyValueCollector();

            SomeClass actual = _builder
                .SubclassObject(collector.SomeString("string").SomeDouble(1.23))
                .Build();

            var actualChild = actual.SubclassObjects.FirstOrDefault();

            Assert.AreEqual(1, actual.SubclassObjects.Count);
            Assert.AreEqual("string", actualChild.SomeString);
            Assert.AreEqual(1.23, actualChild.SomeDouble);
        }