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); }
public void InstantiatesClassWithParameterlessConstructor() { Assert.AreEqual(false, typeof(House).IsPublic); Assert.AreNotEqual(null, DynamicInstanceBuilder.CreateInstance(typeof(House))); }
public void InstantiatesPublicClassWithNoParameterlessConstructor() { Assert.AreEqual(null, typeof(MarshallingContext).GetConstructor(Constants.BINDINGFlags, null, new Type[0], null)); Assert.AreNotEqual(null, DynamicInstanceBuilder.CreateInstance(typeof(MarshallingContext))); }