Mocking classes that aren't interfaces

前端 未结 3 1087
无人共我
无人共我 2020-12-11 17:37

I\'ve been writing some providers in c# that inherit from the providerbase class. I\'ve found that it\'s hard to write tests that use the providers as most mocking framework

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 18:15

    Mocking frameworks should be able to create for you a mock object based on a class, as long as it's got virtual members.

    You may also want to take a look at Typemock

提交回复
热议问题