public bool CanConvert(Type type) { if(type == null || type == typeof(HALResponse)) { return false; } // Is it worth caching this check? return type.GetTypeInfo().GetCustomAttributes().Any(x => x is HalModelAttribute); }
public void Should_not_be_able_to_convert_non_attribute_marked_model() { var model = new object(); var converter = new HALAttributeConverter(); Assert.False(converter.CanConvert(model.GetType())); }