This article describes how to use NUnit to test the Private and Protected methods in. NET.
I have previously written an article to introduce the usage of NUnit. Click here to get the details of this article. this article explains the basic usage and advanced usage of NUnit. when I read the hibernate Article http://netflu.cnblogs.com/archive/2005/08/26/223294.html, I think the private and protected methods should be added. This article is complete.
In my project, I have never tested the private and protected methods, but only the public methods. because I don't think it is necessary. therefore, I wrote the following comments in my hibernate article:
If you want to testProtectedOrPrivateOr not.,However, I think that since the method is locatedProtectedOrPrivate,There is not much need to test.In addition,I personally think it does not play a positive role in testing.,On the contrary, it may have negative effects..BecauseTDDNot just thanks for testing.,It has many advantages..
However, this article is very valuable..
In any case, I wrote this article as a supplement to the previous article.
For details, see here.
Related content:
NUnit detailed usage, http://confach.cnblogs.com/archive/2005/06/20/177817.html
Refer:
1) How to Test Private and Protected methods in. NET, TimStall,
2) use nUnit to test the Private and Protected methods.