예제 #1
0
        internal object Unmarshal(Type type)
        {
            object result = context.Find();

            if (result != null)
            {
                return(result);
            }
            if (reader.GetAttribute(Attributes.Null) == true.ToString())
            {
                return(null);
            }
            result = DynamicInstanceBuilder.CreateInstance(type);
            context.StackObject(result);
            UnmarshalAs(result, type);
            return(result);
        }
예제 #2
0
 public void InstantiatesClassWithParameterlessConstructor()
 {
     Assert.AreEqual(false, typeof(House).IsPublic);
     Assert.AreNotEqual(null, DynamicInstanceBuilder.CreateInstance(typeof(House)));
 }
예제 #3
0
 public void InstantiatesPublicClassWithNoParameterlessConstructor()
 {
     Assert.AreEqual(null, typeof(MarshallingContext).GetConstructor(Constants.BINDINGFlags, null, new Type[0], null));
     Assert.AreNotEqual(null, DynamicInstanceBuilder.CreateInstance(typeof(MarshallingContext)));
 }