NUnit usage (Supplement)-How to Use NUnit to test the Private and Protected methods in. NET

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.