When using Visual Studio, it is easy to extract an interface from a class that I wrote myself. I right-click on the class and select "Refactoring", then select "Extract Interface".
Suppose for a second that I wanted to create a ConfigurationManager wrapper and write some tests around it. A quick way to do this is to extract the interface from the ConfigurationManager by right-clicking it, then Go to Definition, and then from the class select Refactoring, then select Extract Interface. Then I just create my wrapper class, inherit from my newly created interface, and then implement it, and I have a great starting point for my wrapper class.
However, extracting an interface from any .NET system classes is not possible, possibly because it is just metadata about the classes, not the classes themselves (or I'm doing it wrong).
Is there an easy way to do what I'm trying to accomplish? I want me not to waste time typing what I do not need to print.
thank
source
share