A sample test fixture using attributes:
- Loads one or more test assemblies and displays the hierarchy of tests, implemented in those assemblies.
- Runs all tests in a separate thread and a separate appdomen thus isolating the application from the code under test. The GUI stays responsive.
- Finds test fixtures (classes containing tests) and tests based on attributes or based on naming conventiones. No common baseclass or interface implementation required.
- Supports attributes based implementation of test fixtures. ([TestFixture], [SetUp], [TearDown], [SetUp], [Ignore("...")]).
- Setup and TearDown attributes for fixture specific setup and teardown code.
- TestAssemblyFixture with SetUp and TearDown for assembly specific setup and teardown code.
- Categories for grouping tests. Each test fixture and test can be in multiple categories.
- Tests can be written in any .NET language
- Shadow copies all used assemblies. A new version of the test assembly can be built while tests are still running.
- Displays count of executed tests, errors, failures, skipped tests, and assertions.
- Displays amount of time needed to execute the configured tests.
- Displays the location (file and linenumber) of each error and failure. This includes the call stack for easier debugging.
- Displays skipped tests and the reason why they have been skipped.
- Redirects Console.Error and Console.Out to a separate tab.
- csUnit helps reducing test effort by displaying basic statistics about test cases such as absolute and relative time consumed. Times are measured using a high-resolution timer (100ns) for better accuracy.
- csUnit 2.2 and later support parameterized tests with as many parameters as needed.
The csUnit addin supports several programming languages. A sample project for each of these languages is installed during setup (see sources.zip).
Integration points include:
- "Build and Run Tests" in the context menu on any project written in one of the supported programming languages. Selecting this item automatically builds the project target, shows the csUnit toolwindow (if hidden), and runs the tests contained in the project target.
- "Build And Debug Tests" automatically builds the project, sets up the debugger, and runs the tests under the debugger. You can set breakpoints just as you would do for any other debugging session.
- "csUnit for VisualStudio" in the "Tools" menu launches the tool window.
Here is a full size picture of a csUnit-enabled project opened in Visual Studio 2005.