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.