Example #1
0
        public void CompositeSubOneXml()
        {
            Container c = new Container(new WcSubOne("testing", 1));
            SimplTypesScope simplTypesScope = SimplTypesScope.Get("compositeTScope", typeof(Container),
                                                                     typeof(WcBase), typeof(WcSubOne),
                                                                     typeof(WcSubTwo));

            TestMethods.TestSimplObject(c, simplTypesScope);
        }
Example #2
0
        public void CompositeSubTwoJson()
        {
            Container c = new Container(new WcSubTwo(true, 1));
            SimplTypesScope simplTypesScope = SimplTypesScope.Get("compositeTScope", typeof(Container),
                                                                     typeof(WcBase), typeof(WcSubOne),
                                                                     typeof(WcSubTwo));

            TestMethods.TestSimplObject(c, simplTypesScope, Format.Json);
        }
Example #3
0
        public void CompositeClassEmitsCorrectClassDescriptor()
        {
            var containerDescriptor = ClassDescriptor.GetClassDescriptor(typeof(Container));
            var wcBaseDescriptor = ClassDescriptor.GetClassDescriptor(typeof(WcBase));

            var wcDesc = containerDescriptor.GetFieldDescriptorByFieldName("wc");

            Assert.IsTrue(wcDesc != null, "No field descriptor for wc!");
            Assert.AreEqual(typeof(WcBase),wcDesc.Field.FieldType);
            Assert.IsTrue(ClassDescriptor.GetClassDescriptor(wcDesc.Field.FieldType).Equals(wcBaseDescriptor),string.Format("wc Field type is not correct! {0} | {1}",wcDesc,ClassDescriptor.GetClassDescriptor(wcDesc.Field.MemberType)));

            var instance = new Container(new WcBase(1));
        }