public void Read_ObjectHasValidPropertiesInBaseClass_BaseClassPropertiesAreDeserialized() { const string value = "42"; var dictionary = new Dictionary<string, string> { {"ChildProperty", value}, {"BasePropertyInternalSet", value}, {"BasePropertyPublicSet", value} }; var deserialized = dictionary.Read<ObjectWithValidPropertiesInBaseClass>(); Assert.AreEqual(value, deserialized.ChildProperty); Assert.AreEqual(value, deserialized.BasePropertyInternalSet); Assert.AreEqual(value, deserialized.BasePropertyPublicSet); }
public void ReadType() { Dictionary<string, object> dict = new Dictionary<string, object>(); dict.Add("Key 1", "Value 1"); dict.Add("Key 2", "Value 2"); dict.Add("Key 3", "Value 3"); var t = dict.Read<List>(); Assert.AreEqual(typeof(NUnit.Framework.List), t.GetType()); }