Using NBehave in .NET 2.0 Project

Jun 5, 2009 at 5:28 PM

I would like to use NBehave in a .NET 2.0 project. I created a small sample project to see whether it would be suitable. The only issue I ran into is with NBehave.Spec.*.Extensions.ShouldBeThrownBy. It depends on System.Action which isn't available in 2.0. Is there an alternative without resorting to using something like ExpectedExceptionAttribute?

Jun 6, 2009 at 6:50 AM

Theres nothing in the code today, but it be a small effort to implement that.
I'd be more than happy to receive a patch for this ;)


Jun 7, 2009 at 9:33 AM
Edited Jun 7, 2009 at 9:33 AM

I changed the Action to a delegate, I hope thats enough to make it useful in 2.0

Jun 8, 2009 at 2:12 PM

Just to see what would happen, I checked out the source and changed all the projects to target .NET 2.0 and tried to compile. There is a lot more work that would have to be done to get it working properly under 2.0, probably more than anyone would be willing to undertake. Turns out ShouldBeThrownBy was just the tip of the iceberg. Just at first glance there were at least 165 errors spanning 27 files. Most were dependencies on System.Core, System.Action and System.Linq.

It was a good idea anyway.