예제 #1
0
        public void Object_item_4_should_be_reference_type()
        {
            var item = new DynamicObjectMapper().Map <CustomClass>(dynamicObject).Items.ElementAt(4);

            item.ShouldBeOfType <CustomReferenceType>()
            .StringProperty.ShouldBe("S 2");
        }
예제 #2
0
        public void Object_item_3_should_be_value_type()
        {
            var item = new DynamicObjectMapper().Map <CustomClass>(dynamicObject).Items.ElementAt(3);

            item.ShouldBeOfType <CustomValueType>()
            .Int64Property.ShouldBe(42L);
        }
예제 #3
0
        public void Fourth_element_should_be_dynamicobject_for_customtype()
        {
            var element = dynamicObjects.ElementAt(3);

            element.Type.Type.ShouldBe(typeof(CustomType));
            element["Int64Property"].ShouldBe(42L);

            var value = new DynamicObjectMapper().Map(dynamicObjects).Cast <object>().ElementAt(3);

            value.ShouldBeOfType <CustomType>();
            ((CustomType)value).Int64Property.ShouldBe(42L);
        }