Home Download Documentation Getting Started Support Other Versions

Attributes

csUnit uses attributes to markup tests. This includes the tests themselves but also setup and teardown, skipping tests, or expressing expected exceptions.

DataRow Attribute

Use this attribute to specify a set of values for parameterized tests, also known as data-driven tests. More...

DataSource Attribute

Used to specify a source for table based sets of values for parameterized tests, also known as data-driven tests. More...

ExpectedException Attribute

For 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 Attribute

A method marked with this attribute is executed once before any of the tests in the test fixture is executed.

FixtureTearDown Attribute

A 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 Attribute

A test method marked with this attribute is not executed. csUnit skips it and reports it in the graphical user interface.

SetUp Attribute

A 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 Attribute

Use 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 Attribute

You 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 Attribute

Probably the second important attribute. Use this to mark all methods that are tests within your code. More...

TestFixture Attribute

Use this attribute to mark all classes that contain tests. More...

Sponsors:

Extreme Simplicity Logo

Agile Utilities Logo


Sources hosted by

Get csUnit - unit testing for .NET at SourceForge.net. Fast, secure and Free Open Source software downloads



Copyright © 2002-2009 by Agile Utilities NZ Ltd. All rights reserved. Site design by Andreas Weiss. This site is protected by bot traps.