Mocking a base class method call with Moq

后端 未结 6 1766
不思量自难忘°
不思量自难忘° 2020-12-06 16:12

I am modifiying a class method which formats some input paramater dates which are subsequently used as params in a method call into the base class (which lives in another as

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 16:24

    Agree with Mark, it's not possible using Moq.

    Depending on your situation you may consider swithcing from inheritance to composition. Then you'll be able to mock the dependency and verify your method. Of course in some cases it just might not worth it.

提交回复
热议问题