How do you test private methods with NUnit?

后端 未结 13 2396
春和景丽
春和景丽 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 16:52

    The main goal of unit testing is to test the public methods of a class. Those public methods will use those private methods. Unit testing will test the behavior of what is publicly available.

提交回复
热议问题