Confusing concepts in nunit usage

Source: Internet
Author: User
Today, I downloaded nunit and conducted a test to record some problems during use. Don't forget it.

Features

<Testfixturesetup>: Operations performed before all tests start. If a problem occurs, the test fails.



<Testfixtureteardown>:Operations performed after all tests are completed. If a problem occurs, the test fails.



<Setup>: The test fails when a problem occurs during each test.



<Teardown>: The operation performed after each test is executed. If a problem occurs, the test fails.

<Test>:Methods marked as test



<Expectedexception (exception type)>: used to capture exceptions,When this exception occurs, the test passes, For example, <expectedexception (GetType (exception)>

<Ignore (Note)>: indicates the method used to ignore the flag. This method is skipped during runtime. For example: <ignore ("skip it, do not test")>

All tests on nunit on the Internet are C #, VB. NETProgramNo code required?

There was a small problem when handling caught exceptions, first in VB. nunit must be referenced in the usage of features in. net. framework, followed by the connection of two consecutive features should be used in a similar way as follows: <Test (),Expectedexception (GetType (exception)> Public sub test ()....

It is also an understanding of the concept, that is, capturing exceptions means that exceptions are counted as passing the test (Green). OtherwiseRed, Dizzy for a while.

PS: In the process of using VB. NET + VB + vbcommenter + ndoc, the output msdn style document contains garbled Chinese characters. Why? Dizzy.

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.