Search code examples
unit-testingresharperbddtestdriven.netmspec

MSpec runs under ReSharper fine, but TD.NET throws exception


I've been receiving this exception when trying to run mspec specification tests with TD.NET.

------ Test started: Assembly: DesignRightWeb.Specs.dll ------

Error: Runner failure: System.Runtime.Serialization.SerializationException: Type is not         resolved for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications,     Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at     Machine.Specifications.Runner.Impl.AppDomainRunner.CreateRunnerAndUnloadAppDomain(String     runMethod, AppDomain appDomain, Assembly assembly, Object[] args) in d:\BuildAgent-    01\work\340c36596c29db8\Source\Machine.Specifications\Runner\Impl\AppDomainRunner.cs:line     81
Test 'T:DesignRightWeb.Specs.given_a_string_calculator' failed: Type is not resolved     for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications,     Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
    System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Machine.Specifications.Runner.RunOptions,Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null'.
    at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
    at Machine.Specifications.Runner.Impl.AppDomainRunner.CreateRunnerAndUnloadAppDomain(String runMethod, AppDomain appDomain, Assembly assembly, Object[] args)
    at Machine.Specifications.Runner.Impl.AppDomainRunner.RunMember(Assembly assembly, MemberInfo member)
    at Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member)
    at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
    at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

0 passed, 1 failed, 0 skipped, took 1.12 seconds (MSpec).

I've tried installing MSpec straight from Github and also installed it using NuGet. After that - while receiving this same exception - I uninstalled TD.NET and re-installed TD.NET. Still receiving this exception.

Any ideas? Thoughts? Solutions?


Solution

  • Could be you need to register the MSpec test runner into TestDriven.NET? Check out this post to help you:

    http://eduncan911.com/blog/registering-mspec-runners-for-testdriven-net-on-windows-x64.aspx