impromptu-interface
impromptu-interface copied to clipboard
A CanActLike<TInterface>extension method would be nice for unit testing
Using dynamic proxies opens us up to runtime errors since C# can't type-check when "casting" an object to an interface it doesn't actually support. It would be nice if there were a CanActLike method which would scan an object's type and check to see if it actually supports the methods specified, so that can be unit-tested against.
Sorry if there is such a method already; I searched through Impromptu.cs which seemed to be the logical place for that and didn't find one!