I was just skimming thru the ASP.NET MVC code and found this little nasty guy.
You should never widen your interface to enable unit testing. Doing so is a code smell, and there is (almost) always a better way.
[SuppressMessage(
"Microsoft.Usage",
"CA2227:CollectionPropertiesShouldBeReadOnly",
Justification = "Property is settable so that the dictionary can be provided for unit testing purposes.")]
protected internal ModelBinderDictionary Binders {
get {
if (_binders == null) {
_binders = ModelBinders.Binders;
}
return _binders;
}
set {
_binders = value;
}
}