How to Mock the Internal Method of a class?

后端 未结 6 2064
别跟我提以往
别跟我提以往 2020-12-05 18:07

I have a class which has a internal method and i want to mock the internal method . But i am unable to mock it i.e. it is not calling the mocked function but calling the ori

6条回答
  •  臣服心动
    2020-12-05 18:38

    If you need to test lots of code that you can't change, you should better go with MS Moles or TypeMock from the beginning.

    Free mocking frameworks like Moq give you only support on interfaces and virtual methods anyway. Does not sound as if you will go far with that...

    Thomas

提交回复
热议问题