NUnit 2.5 Alpha 1 Release – April 18, 2008
Note: Since this is an alpha level release, the features are not complete and some features present in this release may be removed or changed in future releases.
General
-
There are no longer separate distributed packages for .NET 1.1 an 2.0. Both the binary zip and msi packages contain subdirectories for .NET 1.1 and 2.0. In the case of the msi, the user may elect to install either or both of them.
-
The Visual Studio solutions and projects are now in a directory tree that is parallel to the source tree. This eliminates problems where the VS2003 and VS2005 builds were interfering with one another and makes room for adding VS2008.
-
NUnit is now built using NAnt 0.86 beta 1
-
The windows installer is now created using WiX 2.0.5085
Framework
- Two new attributes have been added to support passing arguments to test methods:
-
TestCaseAttribute allows the programmer to specify the arguments and a number of optional parameters inline.
-
DataSourceAttribute identifies a static property that will provide the arguments and other parameters.
Two new constraints have been added to permit testing of application-created paths, without requiring that they exist in the file system. The following syntax is supported:
-
Is.SamePath(string)
-
Is.SamePathOrUnder(string)
-
AreEqual(DirectoryInfo, DirectoryInfo)
-
AreEqual(string, string)
-
AreNotEqual(DirectoryInfo, DirectoryInfo)
-
AreNotEqual(string, string)
-
IsEmpty(DirectoryInfo, DirectoryInfo)
-
IsEmpty(string, string)
-
IsNotEmpty(DirectoryInfo, DirectoryInfo)
-
IsNotEmpty(string, string)
-
IsWithin(DirectoryInfo, DirectoryInfo)
-
IsWithin(string, string)
-
IsNotWithin(DirectoryInfo, DirectoryInfo)
-
IsNotWithin(string, string)
The DirectoryAssert class has been added, providing the following Methods:
The method Assert.Throws(Type expectedException, TestSnippet code) has been added to provide more control over tests of expected exceptions. TestSnippet is a delegate, which may of course be supplied anonymously under .NET 2.0. If the correct exception type is thrown, the actual exception is returned from the method, allowing further verification to be performed.
-
The Assert.DoesNotThrow method may be used to verify that a delegate does not throw an exception.
-
The Assert.Pass method allows early termination of a test with a successful result.
-
The Assert.Inconclusive method allows returning the new Inconclusive result state.
-
All Asserts and Constraints work with nullable types.
-
Assert.IsInstanceOf<T>(object actual);
-
Assert.IsNotInstanceOf<T>(object actual);
-
Assert.IsAssignableFrom<T>(object actual);
-
Assert.IsNotAssignableFrom<T>(object actual);
-
Assert.Throws<T>(TypeSnippet code);
-
The IAsserter interface
-
The AbstractAsserter class
-
The Assertion class
-
The AssertionFailureMessage class
-
The old NUnit.Framework.TestCase class used for inheriting test classes
-
The Assert.DoAssert() method
-
Two ExpectedExceptionAttribute(Type, string) constructor
-
Two ExpectedExceptionAttribute(string, string) constructor
NUnit now includes added funtionality in the .NET 2.0 build of the framework. The following additional features are supported:
Some Asserts allow an alternate generic syntax for convenience:
The following obsolete interfaces, classes and methods have been removed:
The syntactic constructs in the SyntaxHelpers namespace have been moved to the NUnit.Framework.Syntax.CSharp namespace. The old namespace may still be used for existing classes, but will not be supported after the 2.5 release.
Core
-
NUnit now allows use of static methods as tests and for SetUp, TearDown, TestFixtureSetUp and TestFixtureTearDown.
-
Failures and Errors are now distinquished internally and in summary reports. Methods that are not run because they are invalid are also reported separately.
Console
-
The summary report now displays Errors, Failures, Inconclusive, Ignored and Skipped tests separately. More detailed information on non-runnable tests and setup failures is provided.
-
The console summary report is no longer created using a stylesheet, which renders the /transform option meaningless. The option has been removed.
Gui
-
The default GUI display now uses a single tab for all text output. For users upgrading from an earlier release, the current settings are honored. If you wish to change to the new default, use the Restore Defaults button on the Text Output settings dialog.
-
The final test run display shows a more detailed summary: passed tests, errors, failures, inconclusive, non-runnable, skipped and ignored.
-
The status bar now displays errors and failures separately in.
-
The tree display shows non-runnable tests in red and inconclusive tests in orange. Inconclusive tests are temporarily listed on the Tests Not Run tab for this alpha release.
Extensibility
-
A new extension point ParameterProviders allows addins to provide data for parameterized tests.
- The following extensions are included in the nunit.core.extensions and nunit.framework.extensions assemblies:
-
The MaxTime extension, which was previously a sample.
-
The RowTest extension, which remains an alternative to NUnit’s native TestCase syntax.
-
The XmlConstraint extension, which allows comparing two xml files
Technorati Tags: agile,NUnit,Software Engineering,TDD,C#,Fluent API



