How do you unit test private methods?

前端 未结 30 1841
无人及你
无人及你 2020-11-22 06:44

I\'m building a class library that will have some public & private methods. I want to be able to unit test the private methods (mostly while developing, but also it coul

30条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 07:42

    I tend not to use compiler directives because they clutter things up quickly. One way to mitigate it if you really need them is to put them in a partial class and have your build ignore that .cs file when making the production version.

提交回复
热议问题