Running XUnit.net Tests with TestDriven.net
Asked Answered
S

2

14

I've used NUnit for years and I wanted to try XUnit. So I installed XUnit and ran the executable that allowed you to run XUnit via TD.net.

I can't seem to run more than one test at a time. With NUnit + TD.net, I could click on the filename in the solution and run all the tests in the file. I can't seem to do that with XUnit + TD.net.

Is this something I can do?

Synthiasyntonic answered 29/11, 2008 at 14:35 Comment(0)
C
17

Make sure you run the installer that comes with XUnit.net. There is a button to click that will install the TestDriven.net support.

The problem you are having is described here: http://www.codeplex.com/xunit/Wiki/View.aspx?title=FaqTestDrivenNet&referringTitle=Home

Corriecorriedale answered 26/2, 2009 at 15:4 Comment(0)
M
8

Short Answer: Copy the following into a .reg file on your computer, updating the path to where your Xunit dll resides, and then import it into your registry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\MutantDesign\TestDriven.NET\TestRunners\xunit] @="4" "AssemblyPath"="C:\_Files\Programs\Programming\XUnit\xunit-1.1.0\xunit.runner.tdnet.dll" "TypeName"="Xunit.Runner.TdNet.TdNetRunner"

Long Answer:

I've run into this problem a couple of times, both on 32 and 64 bit versions of windows. TestDriven.net uses the registry to store a list of test frameworks avaialable. XUnit comes with an installer xunit.installer (run as admin) which is supposed to make the correct registry entries.

Usually I can get TD.net to work with XUnit for awhile, then I loose support. Today I was trying to get it to work on Windows 7 beta for the first time and couldn't get it to work at all.

After some searching I found the registry key that the information about the test framework should be entered in.

HKEY_LOCAL_MACHINE\SOFTWARE\MutantDesign\TestDriven.NET\TestRunners

Now on 64bit systems, there is also a key under the Wow6432Node, which is where it looks like the Xunit installer was setting the registry key.

Anyway, I exported the the the xunit registry key from HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MutantDesign\TestDriven.NET\TestRunners\xunit and, edited it, removing the Wow6432Node and then imported it. After restarting visual studio, everything works. I'll keep the registry file around in case it breaks again.

Mcclary answered 24/1, 2009 at 5:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.