c# - Mocking none interface classes -


Is it true that in general, classifying frames and rhinos, only in specific socks, classes of interfaces and virtual methods Make fun of For example, I can duplicate the following simple classes:

  public class MyClass {void method1 () {// some code goes here}}  

If the answer is true, why is such a limit? Is there a work-around?

The range exists, because the malling frameworks method1 is without a virtual or an interface This is a fair limitation, because the interface allows you to reduce your dependency and this good code is a common feature of the IMO. Unfortunately, most of the time. There are no virtual methods or interfaces in the net framework ... the interface that requires ugly wrapping is required.

If you really do not like it, then there is the option of a funny structure that hooks CLR with some crazy magic fu and crosses the border. That is called fame.


Comments