开发者

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

开发者 https://www.devze.com 2022-12-13 05:02 出处:网络
I\'m writing some code that integrates pretty tightly with lots of internal and sealed classes inside of System.Data ( like DbDataRecordand ObjectStateEntry ) for an EntityFramework project I\'m worki

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

精彩评论

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