InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

NUnit 2.5 had been Released

Posted by Mark Levison on May 08, 2009

Sections
Process & Practices,
Development
Topics
Unit Testing ,
Agile ,
.NET Framework ,
.NET
Tags
TDD ,
NUnit

Although only a small version number change (from 2.4.8), NUnit 2.5 represents a large amount of new functionality and has been nearly a year in the making. Charlie Poole, consultant and developer of NUnit, has written a top ten feature list:

Reason 1: Data-Driven Tests Test methods may have arguments and the data for them may be supplied in a number of ways: inline, from a separate method or class or randomly. This feature gives you a succinct way to express a set of examples to be used in running individual test cases.

Reason 2: Theories Traditional, example-based, testing allows you to select one or more sets of values to use in testing such a program. A Theory, on the other hand, allows you to express the generalization itself, writing a test that will pass for whatever values are passed to it, provided they meet the stated constraints.

Reason 3: Inline Expected Exception Tests With the introduction of the Assert.Throws assertion method and the even more powerful constraint expressions Throws.Exception, Throws.InstanceOf and Throws.TypeOf, exception testing logic can now be moved right into the test along with any other necessary assertions.

Reason 4: Generic Support and Reason 5: Lambda Support

Reason 6: Out-of-Process Execution and Runtime Selection NUnit 2.5 extends the AppDomain isolation approach to running tests under one or more separate processes. Aside from the isolation it provides, this allows running the tests under a different version of the .NET runtime from the one NUnit is currently using.

Reason 8: Source Code Display The new stack trace display in the Errors and Failures tab of the Gui is able to display the source code at the location where a problem occured, provided the source is available and the program was compiled with debug information. Currently, syntax coloring for C# is provided.

The release notes go on to provide more detail and describe other features.

Simone Busoli, says that the new constraints model is alot more expressiveness. In addition he likes the new assertions and modifiers to customize those assertions. In particular he notes that: “having modifiers accept inline methods is great for the million times when you have to compare two objects for in/equality and you want to override the concept of equality those objects have in your domain.”

Olof Bjarnason finds the new Timeout Attribute to be valuable when developing loops. In the past when mistakes were made and an infinite loop was written you had to kill the NUnit process. Now the timeout will just break out of the test.

In addition Jamie Cansdale has released a new version of TestDriven .NET, a tool that allows developers to run their NUnit (and other frameworks) Tests inside Visual Studio.

Charlie promised that in the future there will be a return to smaller more frequent releases. The NUnit 3.0 Roadmap(pdf) promises support for a great variety of test runners (including Web runner which will execute tests on a web server). The test engine layer will add support for distribution and running tests in parallel; random ordering of tests and Transactional test behavior.

Other .NET Unit Test tools include: MBunit, CSUnit, xUnit.Net, NBehave and Gallio - an open, extensible, and neutral test runner designed to support all .NET test tools.

  • This article is part of a featured topic series on Agile

Related Sponsor

In today’s hyper-competitive world, later may be too late to adopt Agile development and this Roadmap for Success will help you get started. Download "Agile Development: A Manager's Roadmap for Success" now!

No comments

Watch Thread Reply

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.