1

I want the ability to run NUnit tests from xUnit using somehting like xunit.nunit.dll.

4 Answers 4

1

There was a RunWithAttribute in a sample which did just that, but it's no longer on trunk. There's a thread on the Codeplex forum explaining why it had to be removed.

Unless you have a seriously interesting quantity of legacy tests and can't port, I strongly suggest not getting yourself into two-test-frameworks land - no good can come of it.

0

You could attach the debugger with the xUnit test cases from visual studio is by clicking on the tools, go to process and click on xunit.exe, then when you execute your testcases, they will break into visual studio and hence you got the ability to debug the test cases

1
  • Can you explain this a little further please - as I understood it the issue is that you have an xunit test and an nunit test and the OP wants to run xunit.exe and get 2 xunit test results. That's what my answer addresses (even if its questionable thing to do). I dont see what's new here - this goes for any test runner. I'm all ears! Dec 16, 2011 at 9:02
0

If you use nuget to get the latest version of of Xunit, then search and replace to . As long as you are using basics asserts it should just work.

2
  • Thanks Rubin, will you please give me the link of the codeplex thread, that you are refering. Jul 7, 2011 at 4:14
  • @MSingh: Whoever Rubin is will never see this unless you say @Ruben or comment on my post. I'd need to google to find the discussion buttrust me, there was one and its worth looking. something like +NUnit site:xunit.codeplex.com. As I recommended elsewhere, consider porting unless you have a lot of tests. Again, some searching required. Jul 14, 2011 at 18:25
0

As I understand your question, the core issue here is that you've got tests written in two unit testing frameworks: xUnit.net and nUnit and you want to run them all with one runner (if that's not the issue, please disregard this answer). In this case, you might wanna take a look at Gallio. Part of the package is Icarus Runner that can run unit tests from at least nunit, xunit.net, mbunit. It is in some ways limited (e.g. when you extend nunit or xunit by creating custom subclasses for attributes used to mark the test method, Icarus does not see them anymore), but most of the time, you should be fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.