I'm trying to get XUnit to work with Visual Studio 2013 Community (Version 12.0.31101.00 Update 4).
I've got NUnit to work so I thought it would be simple to get XUnit to work.
The code is
using Xunit;
namespace Xunit
{
public class Class1
{
[Fact]
public void myFirstTest()
{
Assert.False(true);
}
}
}
I've used the NuGet Package manager to install the following.
XUnit.net is version 1.9.2
XUnit.net: Runners is version 1.9.2
I've seen videos of people running XUnit with VS2012 but no one with 2013.
Any ideas?
You need to install the "xunit.runner.visualstudio" as a nuget package, currently in beta, so run in package manager console:
Install-Package xunit.runner.visualstudio -Pre
or look for it in the GUI, but do select "include prerelease" as explained in the new docs.
OK - as of today, 20 Jan 2015, I have managed to get Xunit working on VS2013 Community with the stable 1.9.2 Xunit.net and the pre-release "Visual Studio Runner 2.0 RC1".
1.9.2 Xunit visual studio runner, didn't pick up xunit tests in Test Explorer
2.0RC1 Xunit.net installation fails complaining about filename/path is too long.
But the combination of 1.9.2 Xunit.net & 2.0RC1 Xunit Studio Runner works well for me. I guess tomorrow! or whenever they release the final version of Xunit, I can replace 1.9.2 Xunit.net with the latest.
it may be the option under Test->Test Settings-> Keep test execution engine running.
If you have both MSTEST and XUNIT, it has a problem switching.
Also if resharper is installed you can Uncheck enable unit tests through the options. though this seems to be mostly with resharper 8.1
Also found had to move xunits out of Test project and even then this is hit or miss.
keyword: executor://xunit/VsTestRunner2
Related
I have a Jenkins server setup to build a mixed C++/C# application. I've got Visual Studio Test Agent 2017 and Visual Studio Build Tools 2017 installed but I can't build the Visual Studio test projects. The error I get is:
error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft'
It looks as though the appropriate assemblies are not available.
I'm using this SDK to install tools for Visual Studio 2015 which is possible with the 2017 SDK and that part works fine - I can build VS 2015 projects. Except for test projects.
Is there some extra package I need to install in order to make this work? My alternative is to install NUnit but that means rewriting the unit tests.
My solution was to use NUnit, since I was unable to find the right SDK to install VS Test without Visual Studio itself.
NUnit required changes to Resharper, file handling and changing the attributes on the test.
I'm having a problem installing XUnit in my visual studio 2013 using .NET Framework 4.5. Any sol'n?
BTW: I'm installing this using NUGET
Error Image (Click Me)
Instead of using XUnit.Net what I used as alternative is Specflow.xunit and it is working.
I have visual studio 2013 express edition and I have referenced NUnit 2.6.2 version DLL, but I don't know why the Test Explorer is not showing the test cases.
I did searched for questions with similar problem and tried doing what suggested like the Nunit Framework from NuGet package and making sure the Nunit reference and adapter version are correct, etc. but none of them resolved the issue.
Right now I have cleaned up everything from my Visual Studio and have only Nunit 2.6.2 DLL added in reference.
Following is the out put from Package manager console.
PM> Get-Package
No packages installed.
Can someone please help me to know how to get the Nunit tests in my Test Explorer ?
You need the NUnit Test Adapter and not the NUnit 3 Test Adapter since you are using version 2.
Sorry... The NUnit Test Adapter and the NUnit 3 Test Adapter are both Visual Studio extensions. The Express editions of Visual Studio don't support extensions. Period.
You need to switch to either VS2015 or VS2017 Community Edition, which do support extensions. Then you can install either of the two adapters - depending on what version of the NUnit framework you are using.
I tried searching all over the internet, but I couldn't find how to install Chutzpah Test Adapter for the Test Explorer version 3.2.6 for visual studio 2013. In Visual studio Extensions and Updates settings, I am able to see the latest version (4.0.1).
Any idea where I can get Chutzpah test Adapter 3.2.6 version?
You can find an older version of the VSIX here (https://github.com/mmanela/chutzpah/releases/tag/v3.3.1). This is version 3.3.1 which hopefully is good enough.
I set up a new machine this week. It is running Windows 7, 64 bit.
I installed Visual Studio 2010 Professional, then Resharper 5.0, rapidly followed by Resharper 5.1 when it came out soon after.
Since I have a project with tests in MbUnit, I have installed MbUnit/Gallio, using the 3.1.397 version x64 msi installer from here.
I was expecting to see the green gutter icons that Reshaper puts next to my tests, but I do not. I tried removing Gallio and installing the 32 bit version. No change. I re-installed both Resharper as Gallio as per this question, but this produced no change. In this procedure, %APPDATA% is set to C:\Users\Me\AppData\Roaming, so I deleted C:\Users\Me\AppData\Roaming\JetBrains. I have also tried unstalling both Reshaper and gallio, deleting all Resharper and Gallio data from AppData\Roaming, AppData\Local, and C:\Program Files (x86), and then installing again from a cmd running as admin, but again, no change.
Resharper has no plugins listed in the Plugins dialog, and in the Resharper|Options|Unit testing item the "unit testing providers" listed are MSTest and nUnit.
Visual studio has two other Add-ins listed: ".Net Reflector" and "Visual Git".
What do I have to do to get MBUnit working in Resharper?
Which of these two tools provides the integration? Should I install Resharper or Gallio first?
Where do the integration files or settings go? It has been suggested that I should have a "resharper plugins directory" in C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Plugins or similar but this is not present at all.
R# 5.1 RTW is supported by Gallio/MbUnit starting from v3.2.512. You can download the latest binaries of the Gallio bundle in the daily builds repository. v3.2 is not officially released yet but it is very stable already.
UPDATE 1: R#5.1 officially supported.
UPDATE 2: Gallio v3.2 RC with R# 5.0 and 5.1 support.