I'm writing some code that integrates pretty tightly with lots of internal and sealed classes inside of System.Data ( like DbDataRecord and ObjectStateEntry ) for an EntityFramework project I'm working on. Of course the mocking frameworks fall to pieces trying to mock these things.
I still need to test these o开发者_如何学Pythonbjects and AFAIK my only two options are:
Buying TypeMock
Using the decorator pattern to make my own mockable sub classes of these objects.
Decorators seem like the "cheap" and easy choice. Is there a third or fourth choice to mock these objects?
精彩评论