Search code examples
nunitresharpertestdriven.netnbehave

TestDriven.Net nunit.framework error


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?


Solution

  • 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