Static class/method/property in unit test, stop it or not

后端 未结 5 2089
野性不改
野性不改 2020-12-03 07:37

Should a static class/method/property be used in a unit test development environment, given that there is no way to test it without introducing a wrapper that is again not t

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-03 07:59

    Static methods CAN be unit tested. They can't be mocked (generally; there are some frameworks to do this like Moles.

提交回复
热议问题