How do you test private methods with NUnit?

后端 未结 13 2391
春和景丽
春和景丽 2020-12-02 16:00

I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private m

13条回答
  •  失恋的感觉
    2020-12-02 17:00

    Generally, unit testing addresses a class's public interface, on the theory that the implementation is immaterial, so long as the results are correct from the client's point of view.

    So, NUnit does not provide any mechanism for testing non-public members.

提交回复
热议问题