public void GetValidPropertyReturnsAValidProperty() { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(SimpleEntity)); PropertyDescriptor result = TypeDescriptionHelper.GetValidProperty(properties, "Name"); Assert.IsNotNull(result); }
private object FindInstance(IDictionary keys) { return(_data.Find(delegate(object obj) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(obj); foreach (string keyName in keys.Keys) { PropertyDescriptor property = TypeDescriptionHelper.GetValidProperty(properties, keyName); if (!property.GetValue(obj).Equals(keys[keyName])) { return false; } } return true; })); }
public void GetValidPropertyThrowsIfPropertiesIsNull() { TypeDescriptionHelper.GetValidProperty(null, "Unexistant"); }
public void GetValidPropertyThrowsIfPropertyIsInvalid() { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(SimpleEntity)); TypeDescriptionHelper.GetValidProperty(properties, "Unexistant"); }