开发者

Testing internal/closed/sealed System.Data bits. TypeMock or Decorators or xxxxxx?

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:

  1. Buying TypeMock

  2. 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜