public void ShouldNotAccessInexistingProperties() { ReflectionBasedDictionaryAdapter dict = new ReflectionBasedDictionaryAdapter(new Customer(1, "name")); Assert.IsFalse(dict.Contains("Age"), "Age property found when it should not be"); Assert.IsFalse(dict.Contains("Address"), "Address property found when it should not be"); }
public void CanAccessExistingPropertiesInACaseInsensitiveFashion() { var dict = new ReflectionBasedDictionaryAdapter(new Customer(1, "name")); Assert.IsTrue(dict.Contains("id")); Assert.IsTrue(dict.Contains("ID")); Assert.IsTrue(dict.Contains("Id")); Assert.IsTrue(dict.Contains("name")); Assert.IsTrue(dict.Contains("Name")); Assert.IsTrue(dict.Contains("NAME")); }