AttributescsUnit uses attributes to markup tests. This includes the tests themselves but also setup and teardown, skipping tests, or expressing expected exceptions. DataRow AttributeUse this attribute to specify a set of values for parameterized tests, also known as data-driven tests. More... DataSource AttributeUsed to specify a source for table based sets of values for parameterized tests, also known as data-driven tests. More... ExpectedException AttributeFor some tests you may want to test whether a particular exception is being thrown during the execution of the test. If the exception is not thrown the test is considered to be failed. Instead of writing your own try-catch block you can use the ExpectedException attribute to indiceate the expected exception. FixtureSetUp AttributeA method marked with this attribute is executed once before any of the tests in the test fixture is executed. FixtureTearDown AttributeA method marked with this attribute is executed once after all tests in a test fixture were executed. The teardown method is executed regardless of the result of any of the tests. Ignore AttributeA test method marked with this attribute is not executed. csUnit skips it and reports it in the graphical user interface. SetUp AttributeA method marked with the SetUp attribute is executed once before every single test within a test fixture. A SetUp method is used to setup objects that are commonly used by all of the tests within that test fixture. TearDown AttributeUse the TearDown attribute to indicate a method that should be executed after every single test within a test fixture. Note that the TearDown method is executed regardless of the result of the test preceeding it. TestAssemblyFixture AttributeYou can mark a class with this attribute in order to provide code that is executed before any test in a test assembly and/or after every test in a test assembly. Again, if this class provides a teardown method then this method is executed regardless of the outcome of any test in that test assembly. Test AttributeProbably the second important attribute. Use this to mark all methods that are tests within your code. More... TestFixture AttributeUse this attribute to mark all classes that contain tests. More... |
Sponsors: Sources hosted by
|
|||||||
Copyright © 2002-2009 by Agile Utilities NZ Ltd. All rights reserved. Site design by Andreas Weiss. This site is protected by bot traps. |