Nunit tests are not shown in Test Explorer of VS2013 Express - visual-studio-2013

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.

Related

Get Visual Studio Test to work on a Jenkins server

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.

Cannot run Xunit with Visual Studio 2013 Community

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

Can't install Moles in Visual Studio 2010 SP1

I'm trying to install Moles (without Pex, since Pex is only available for free for non-commercial purposes) using the downloads found here (that's the x86 version, I've tried the x64 version as well).
The installer(s) run without errors, and inform me that Moles have been installed correctly. But when I start Visual Studio, I see no trace that this add-in should be installed. It doesn't show up among the installed extensions in Extension manager, and I can't add any Moles items into my projects.
Is there some installation step that I'm missing here?
To check if moles is installed go to:
--> Help --> About Microsoft Visual Studio
If it is in the list, it is installed. To use moles you have to create a test project and go to the reference in the test project you want to mole. Right click and Add Moles Assembly.
I see some posts of VS.NET SP1 with moles. So installing is possible.

MbUnit and Resharper integration not working in Visual Studio 2010

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.

MSTest in Express editions of Visual Studio 2010

I'm leaning toward using MSTest as unit testing framework for a new project but I'm concerned with cutting off developers (maybe even myself in the future and/or in some specific environment) using Express editions of Visual Studio.
I know MSTest wasn't available in VS2008 Express but with Microsoft pushing unit testing in recent years I guess they could've added it to VS2010 Express. However I couldn't find any info on this in the list of Express features and I don't want to download and install express just to verify this.
So, is MSTest supported in Visual Studio 2010 Express?
It does not appear in Microsoft's list of features of Visual Studio Express 2010, and it would appear (according to this blog post) that it is not supported. Since express editions do not allow add-ins, you cannot even use something like TestDriven.net to run tests from within Visual Studio Express editions.
If you were to use NUnit for testing, you may get more mileage. That blog post shows a way of running/debugging NUnit tests using a bootstrapper, but an easier way is to set NUnit as the start action (in Project Properties -> Start External Program), and then passing the name of your dll as an argument. This will start and run NUnit when you run/debug your project, allowing you launch your tests from within Visual Studio, and also debug them if needed.

Resources