xUnit.net runner for Visual Studio

Free

xUnit.net is a unit testing tool for the .NET Framework. Written by the original inventor of NUnit, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages.

(16) Review
Visual Studio
2013, 2012, 14
Download (102,956)
8/10/2014
0.99.8
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (16)
Q and A (24)
Sign in to write a review
Sort by:

by Pat_deux | September 23 2014

It works good for getting code coverage results, but running tests is rather slow than other tools. Tested in VS2012.

by Yves Schelpe (KdG) | November 14 2013

Good and excellent for VS 2012, but issues with VS2013:
01) Tests hang - the first one gets a green arrow but then nothing happens;
02) Test names are full qualified name in stead of just the method name.

by TomasDeml | November 05 2013

by Code Chief | November 04 2013

Works fine with 2013. Essential to enable use of more common/free testing tools,
e.g. when creating open/shared source solutions (people may want to open
and run tests without the premium visual studio/MSTest version available).

by Jedidja Bourgeois | October 25 2013

This is wonderful! For people who don't have TestDriven.Net, Resharper, etc. it brings the power of xUnit to VS.

by AndyCarr | August 07 2013

Useful tool that just works. Integrates nUnit test runner into VS2012

by JonnyBaird | July 18 2013

It just works... simple and straightforward.

by Harvey Darvey | July 04 2013

I like the way it integrates with VS2012. The experience to write and develop in TDD has has been greatly improved for me. Thanks alot!

by Radek Krahl | July 01 2013

Great and useful tool!

by Korez73J | May 10 2013

Simply awesome. Thanks Brad

by Raphaël-wb | January 08 2013

by Kent Boogaart | December 31 2012

xUnit integrated with VS2012 - does it get any better? Many thanks for your hard work, Brad.

by Vagif Abilov | Thu 6:10 PM

It just works!

by Lucas Loegel | September 15 2012

by raj_kba | March 11 2012

Works nicely. Great work!

by Andy_Bfield | March 10 2012

Works like a charm! Install xUnit.net runner, reference xunit.dll in your test project, launch test within Visual Studio and see results in Visual Studio Unit Test Explorer. Awesome integration!

Sign in to start a discussion


  • VS 14 supported?
    4 Posts | Last post September 24, 2014
    • Hi, the extension installs for the VS 14 CTP, but I can't get it to discover any tests in the Test Explorer. Have tried with xUnit v1 & v2 from NuGet. Any ideas?
    • I'm having the same problem. For now I've settled for using the GUI test runner:
      
      https://xunit.codeplex.com/releases/view/90058
    • Oh, and incidentally, you also can't load the xUnit Property Page in the VS Options menu.
    • I have the same issues in VS 2013 Update 3. In ActivityLog.xml there is "Could not load file or assembly 'xunit.runner.visualstudio.settings, Version=0.99.8.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.".
  • Unable to use /TestCaseFilter from command line
    2 Posts | Last post September 11, 2014
    • I am trying to run something similar to the following:
      
      N:\Projects>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "N:\Projects\bin\Debug\IntegrationTests.dll" /usevsixextensions:true /testcasefilter:"TestCategory=Foo" /settings:"N:\Projects\mock.runsettings"
      
      But nothing I do to the TestCaseFilter parameter has any effect. It will always run every test in IntegrationTests.dll. Is there some way to get this to work properly? I am running VS 2013.
      
      (As an aside, the /settings flag does not appear to do anything, either. The settings are always overwritten by the settings from VS.)
    • I am having the exact same issue. Any update on this?
  • Please change xUnit.Net url
    1 Posts | Last post August 14, 2014
    • New website http://xunit.github.io/
  • xUnit runner 0.99.6 and class libraries in .NET 3.5
    3 Posts | Last post July 31, 2014
    • After upgrading xUnit test runner to version 0.99.6 I cannot run unit tests for class library running on .NET 3.5 anymore. I get the following error:
      
      Could not find test executor with URI 'executor://xunit/VsTestRunner2'.  Make sure that the test executor is installed and supports .net runtime version 2.0.50727.5477.
      
      I'm running tests in VS 2012. Downgrading xunit test runner to version 0.99.3 fixed the problem.
      
      Could you advise on what could cause this? Is this a bug in xUnit runner 0.99.6, or is there possibly anything wrong with my VS 2012 setup?
    • It's a bug. :( We should have it fixed for 0.99.7.
      
      https://github.com/xunit/xunit/issues/104
    • Note that you can still get this error in version 0.99.7 if your test methods are declared as non public. 
  • Can not run any of test
    6 Posts | Last post November 26, 2013
    • I have VS 2012 Update 3. 
      I try to run my tests with xUnit.net runner 0.99.0 but no chance. 
      There is test output
      ------ Run test started ------
      System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
         at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
         at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
         at Xunit.TestClassCallbackHandler.OnTest(XmlNode xml)
         at Xunit.TestClassCallbackHandler.OnXmlNode(XmlNode xml)
         at Xunit.XmlNodeCallbackHandler.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
         at System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
         --- End of inner exception stack trace ---
         
    • If this is when debugging, then this is the same issue as 'All tests hang with 0.99'.
    • I have a similar issue (using FsCheck) - my tests all pass so far but as soon as one test throws a exception I get a TargetInvocationException due to a NullReferenceException.
      
      I checked/debuged the FsCheck code and the problem seems not to be in the our code there.
      
      Here is a stacktrace (in german - sorry):
      
      System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
         bei Xunit.TestClassCallbackHandler.OnTest(XmlNode xml)
         bei Xunit.TestClassCallbackHandler.OnXmlNode(XmlNode xml)
         bei Xunit.XmlNodeCallbackHandler.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
         bei System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
         --- Ende der internen Ausnahmestapelüberwachung ---
         bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
         bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
         bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
         bei Xunit.Sdk.ExecutorCallback.CallbackEventHandlerCallback.Notify(String value)
         bei Xunit.Sdk.Executor.OnTestResult(ITestResult result, ExecutorCallback callback)
         bei Xunit.Sdk.Executor.RunTests.<>c__DisplayClass12.<.ctor>b__11(ITestResult result)
         bei Xunit.Sdk.TestClassCommandRunner.Execute(ITestClassCommand testClassCommand, List`1 methods, Predicate`1 startCallback, Predicate`1 resultCallback)
         bei Xunit.Sdk.Executor.RunTests.<>c__DisplayClass12.<.ctor>b__f()
         bei Xunit.Sdk.Executor.ThreadRunner(Object threadStart)
         bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
         bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, B
    • This will be fixed in 0.99.1 (parsing with the invariant culture).
      
      https://xunit.codeplex.com/workitem/9895
    • Please try 0.99.1. Hopefully all issues have been resolved. Let us know if there are any further issues.
    • i still miss test status in code lens with 0.99.1
      i use xunit ver 1.9.2.1705
      my all projects are 64x
      system w8.1 64x
      btw i can run test from test explorer, but i want to see test output in code lens
  • All tests hang with 0.99
    18 Posts | Last post November 25, 2013
    • After upgrading to Version 0.99.0 from Version 0.9.5.4, my xUnit.net tests completely refuse to run. The first one gets a green arrow, and then nothing more happens. Tried creating a new empty solution. MsTests work fine. My development flow is now completely crippled! Is there a way to quickly downgrade?
    • Using VS 2013 and xUnit.net 1.9.2 via NuGet.
    • i get test run, but i miss test status near code lens
      please, fix
    • rolled back to 0.9.5.4 everything works OK
      please, fix your extension
    • Thank you for the bug reports. We will attempt to reproduce them and issue a fix soon.
    • Thank you for looking into this. But HOW do I downgrade?
    • I was able to download the ASP.NET WebStack source code, which contains ~ 14k tests written in xUnit.net 1.9.1, and they discovered and ran fine with the 0.99.0 runner in VS2013.
      
      I then upgraded the tests to use xUnit.net 1.9.2, and once again, they all discovered and ran correctly.
      
      Can either of you provide a repro project that demonstrates the problem you're having?
    • I'm not sure how TURNSKIN85 rolled back, as I'm unable to find a link to the old VSIX here on the Gallery site. I'll work to get an alternative download up soon.
    • You can download the 0.9.5.4 VSIX from CodePlex now: https://xunit.codeplex.com/releases/view/114414
    • Hi, got the exactly same problem
      i can reproduce on any solution - even empty, with an empty test method - co i guess it could be a visual studio configuration problem or something like that
      when debuging i get an exception thrown after the end of the test 
      - details http://pastebin.com/uT3PH7hu
      
      also couldn't find the symbols for xUnit 1.9.2 so i could debug further are they located anywhere public? (i know i could build mine, but that's not the same)
    • Can confirm that with 0.9.5.4 everything is ok.
    • Thank you. The Codeplex link did the job, and now everything works ok again.
      
      I can confirm that I get the same exception. I have provided the test project I used (although I can also reproduce this with ANY test). I have also provided an IntelliTrace file of the exception.
      https://www.dropbox.com/s/5bi374dj0dpmgm5/UnitTestProject1.zip
      https://www.dropbox.com/s/7b5uotoi4ssybfi/vstest.executionengine.x86_131105_230138.iTrace
      
      Please note that when running the test normally (not debugging it), no exception is reported. The test just hangs.
      
      On a sidenote, the test NAME is different in the 0.99 version. Instead of just the local method name, I get the whole qualified method name. (Which pretty much makes it impossible to read the most significant part if you have Test Explorer docked in the default fasion.)
    • Brad, did you get any help from my traces?
    • I can confirm that I have the same issues running VS2013 on Win8.1, xunit runner 0.99:
      01) Tests hang - the first one gets a green arrow but then nothing happens;
      02) Test names are full qualified name in stead of just the method name.
    • here's a screenshot of what I get to see in Vs2013/xUnitRunner v0.99: http://postimg.org/image/h7mdm8lqz/
    • Update, Vs2012.4 with xUnit runner 0.99 works ok, but it does as well display the full qualified name in the test explorer window. Tests don't hang there though.
    • The TargetInvocation issue will be fixed in 0.99.1.
      https://xunit.codeplex.com/workitem/9895
      
      The test name will be configurable in 0.99.1 (and default back to the short name).
      https://xunit.codeplex.com/workitem/9828
      https://github.com/xunit/xunit/commit/8b3cd352977fd9cc1d8db2b6f5ae8821586f9b01
      
    • Please try 0.99.1. Hopefully all issues have been resolved. Let us know if there are any further issues.
  • How to run multiple test span across multiple files
    2 Posts | Last post November 05, 2013
    • Hi,
      
      I an new to VS and xunit. I had created two tests in two separate files, when tried to run 'All Tests' only test present in one file got executed, other test didn't execute, can someone please let me know how to do that
    • The Visual Studio test runner discover tests after compilation. When adding new tests, you must first build your solution before the tests can be found and run.
  • Runner locks unmanaged dll after running tests
    2 Posts | Last post November 05, 2013
    • Hi,
      
      We have solution with unmanaged c project that we test from managed c# code using xunit via c# interop wrapper. We're using tests that are defined as unsafe. After running tests and changing something in c# code build fails with following error: 'The command "copy C:\devel\project\Debug C:\devel\project\managed.Tests\bin\Debug\*" exited with code 1.'. Try to  manually delete c:\devel\project\managed.Tests\bin\Debug\unmanaged.dll ends with system error 'Cannot delete file, because file is open in vstest.executionengine.x86.exe' (it may not sound like that in english version of windows, it's loose translation from my native language :)). The solution is to close visual studio and open it again, then build succeeds. Resharper runner works fine, on the other hand.
      
      Thanks for awesome piece of software, we're using it extensively, it's the only problem we've with it.
      
      Best regards!
    • Have you tried with the latest runner? This problem may be solved now through a different bug fix (we now automatically shut down the VS execution engine after running tests, which should unlock all DLLs).
  • Window Store Apps : Support?
    2 Posts | Last post August 24, 2013
    • Does this testing framework work for windows store apps?
    • This is planned for v2 of the framework, but is not currently available.
  • Out of memory when running lot of tests
    2 Posts | Last post June 21, 2013
    • Hi..
      I’m having a problem with running all xUnit.net tests in the solution. Test runner terminates with out of memory exception and in the Task manager I can see that vstest.executionengine.exe memory usage constantly grows and finally the process crashes. There are about 4000 tests, we are doing lot of mocking with Moq and ninject automocking kernel, somehow I suspect that's the guilty party for this.
      But, when I try to run same tests inside Resharper Unit test session, all tests are run successfully without any excessive memory usage.
      When the TFS build is configured to run the tests, same thing happens on the build server machine, out of memory. 
      My question would be, is there something we could configure so that VS test runner behaves the same as Resharper test runner so that we can run these tests as part of TFS build?
      
      Thanks&Regards
    • I'll see if we can track down the memory usage and fix the issue. Sorry for the inconvenience.
1 - 10 of 24 Items