How to mock with static methods?

后端 未结 7 1065
星月不相逢
星月不相逢 2020-12-05 02:31

I\'m new to mock objects, but I understand that I need to have my classes implement interfaces in order to mock them.

The problem I\'m having is that in my data acce

相关标签:
7条回答
  • The problem you have is when you're using 3rd party code and it's called from one of your methods. What we ended up doing is wrapping it in an object, and calling passing it in with dep inj, and then your unit test can mock 3rd party static method call the setter with it.

    0 讨论(0)
提交回复
热议问题