views:

288

answers:

2

I am running TestDriven.Net version 2.23, NBehave version 0.4.0.133, and nunit version Unit 2.5.0.9122. I am also running the latest version of Resharper. Here is a snipet of test code:

            var address = new Address
                          {
                              ActiveYN = true,
                              Address1 = "555 Main Street",
                              Address2 = "Apt 2",
                              City = city,
                              ModifiedBy = contact,
                              ModifiedDt = clockStub.GetCurrentTime(),
                              ZipCode = "76132",
                              Id = 9
                          };

        Assert.AreEqual(city, address.City);

If I run the Resharper test runner and run TestDriven.Net, the test passes. Now if I change the test syntax to:

            var address = new Address
                          {
                              ActiveYN = true,
                              Address1 = "555 Main Street",
                              Address2 = "Apt 2",
                              City = city,
                              ModifiedBy = contact,
                              ModifiedDt = clockStub.GetCurrentTime(),
                              ZipCode = "76132",
                              Id = 9
                          };

        address.City.ShouldEqual(city);

If I run the test in Resharper test runner, I get passed no errors. If I run with TestDriven.Net I get:

failed: System.IO.FileLoadException : Could not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is a new machine and I never ran nunit 2.4.8 Any thoughts?

+2  A: 

Is the new syntax nunit 2.5 specific? Resharper 4.5 (latest ver) doesn't support nunit 2.5. Resharper doesn't use the nunit assemblies for licensing reasons so even if you have nunint 2.5, Resharper is using it's own version (maybe that could be the 2.4.8??). More info here:

http://www.jetbrains.net/devnet/thread/281286

Abby Fichtner
A: 

If you want to use the latest and greatest NUnit framework and support the new ExpectedExceptionAttribute you should install the Gallio framework and use the Gallio TestRunner in resharper.

Gallio acts as a wrapper around your unit tests, no need to change any of your existing tests. But as it ships with its custom Resharper addin, you shift the dependency between Resharper and Nunit further down the line to Gallio and Nunit, and from my experience, Gallio is updated quite more often than resharper (and open source, so you can even roll your own NUnit v42.1 adapter if you want to, with minimal effort).

www.gallio.org

Cheers, Florian

Florian Doyon

related questions