Exactly as the question says :
How can I MSTEST with Visual Studio 11 Dev Preview ?
I tried to find the mstest.exe but it doesnt exist in its usual location :
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
I wrote some unit tests and there is no way to run them =\
MSTest has never been part of the Express editions of Visual Studio.
MSTest.exe is present on my PC in the specified location.
OTOH, if you just started writing the tests, you may want to look at xUnit.net, some of the reasons being posted here: Why I'm migrating from MSTest to xUnit.net.
For VS11 there is a runner available as an extension: Prototype xUnit.net Visual Studio 11 Unit Testing Plugin
Like #Darin Dimitrov answered, MSTest is not available in Express edition, and you should install the Ultimate edition from here,
http://msdn.microsoft.com/en-US/vstudio/hh127353
Related
Good Morning
Note: I am new to VS and C# coding. Learning and have the following issue.
PROBLEM STATEMENT:
C# Nunit tests from VS 2013 (Nunit v2.x), won't show in Test Explorer in VS 2017 (Nunit 3.x)
BACKGROUND:
Recently identified good scripts for our application written with VS 2013 with C# based on NUnit 2.x.
I have copied them into my machine with VS 2017 and Nunit v.3.10.1 and Nunit3TestAdapter v.3.10.0.
Note: The Tests are running fine in another machine with VS 2013 and Nunit v2.x
Machine and VS config:
- Windows 10 pro 64 bit OS with 64 bit processor
- VS 2017: Default Processor Architecure is set to X64
- At present, "Active Solution Platform" is set to X86 for build settings for my test project (Build > Configuration Manager).
- VS Nuget Package for Nunit: v.3.10.1
- VS Nuget Package for Nunit3TestAdapter: v.3.10.0
What i have done or tried:
- The test project cs file contains [TestFixture] and [Test] in the correct places
- I have tried cleaning / rebuilding the solution multiple times
- I have tried restarting Visual Studio multiple times
- I researched many articles here and in other venues
- Can't get a straight answer yet if it is possible, or impossible or what is the solution.
Thank you very much!
Andrew
Install NUnit3TestAdapter Visual Studio plugin.
In Visual studio, go to Tools -> Extensions and Updates. At the dialog, choose Online from navigation pane, and in the search bar type NUnit, pick the NUnit 3 Test Adapter plugin and install it. Once done, you will be required to restart Visual Studio and rebuild your test project.
With the help of my friend Fahad, the issue seems to be resolved with the following steps:
Unistalled Nunit3TestAdapter v.3.10.0 and Nunit3 v.3.10.0
Manually removed all the "nunit.*" references
Installed the following via NuGet:
Nunit3 v.3.10.1 and Nunit3TestAdapter v.3.10.0
Nunit.ConsoleRunner v.3.8.0
Updated VS 2017 to the version 15.7.3
So at this point I see all the Tests in the Test Explorer. I have another issue with them not running due to this (but possible it is a different issue):
Warnings for not able to run Tests
So Visual Studio doesn't seem to register all my Unit Tests. I have no idea how to solve this, and google hasn't been able to help.
Most of the tests is for some reason labeled as "Inconclusive Tests". This is how the built in Unit Tests displays:
P.S. The test runner works fine when I run the tests in a terminal.
.NET Core test projects in Visual Studio for Mac 7.2 has a bug that would cause the test names to appear blank in the Unit Tests window. This problem was fixed in Visual Studio for Mac 7.3.
Preamble
I know, that this question seems to have anwsers here:
Resharper runs UnitTest from different location
Resharper Unit Test Runner Can't Find Content Files
I have nearly the same problem like ReSharper 10 test runner failing to find AppSettings referenced from external file.
But these answer stated, that the problem should be gone with ReSharper 10.0.2
Question
I included a custom.xml files with custom settings, and I need to read them from my unit test. But my file is not found.
I looked, where the process runs, and included this line
var curdir = Directory.GetCurrentDirectory();
So I found out, that curdir is C:\\Users\\MYUSER\\AppData\\Local\\JetBrains\\Installations\\ReSharperPlatformVs11_000
Now it is obvious that my file cannot be found. After googling it, it found the above mentioned questions. But none of these solutions works for me.
These are my settings:
Visual Studio Configuration
Microsoft Visual Studio Ultimate 2012
Version 11.0.61219.00 Update 5
Microsoft .NET Framework
Version 4.6.01038
Installierte Version: Ultimate
Architecture and Modeling Tools 04940-004-0038003-02857
Team Explorer für Visual Studio 2012 04940-004-0038003-02857
Microsoft Team Explorer für Visual Studio 2012
Visual Basic 2012 04940-004-0038003-02857
Microsoft Visual Basic 2012
Visual C# 2012 04940-004-0038003-02857
Microsoft Visual C# 2012
Visual C++ 2012 04940-004-0038003-02857
Microsoft Visual C++ 2012
Visual F# 2012 04940-004-0038003-02857
Microsoft Visual F# 2012
Windows Phone SDK 8.0 - DEU 04940-004-0038003-02857
Windows Phone SDK 8.0 - DEU
ASP.NET and Web Tools 2012.3.41009
GenerateUnitTest 1.0
Git Source Control Provider 1.0.0.0
JetBrains ReSharper Ultimate 10.0.2 Build 104.0.20151218.120627
Microsoft Advertising SDK for Windows Phone 6.2.923.0
Microsoft Advertising SDK for Windows Phone Build 6.2.923.0
Microsoft XNA Game Studio 4.0
Microsoft XNA Game Studio 4.0
NuGet-Paket-Manager 2.8.60318.667
PreEmptive Analytics Visualizer 1.0
SQL Server Data Tools 11.1.20627.00
Microsoft SQL Server Data Tools
Git Extensions
You don't list any version of NUnit installed, but you tagged this 'nunit' so I'm going to make an assumption you are using it! Further, I'm assuming NUnit >= 3.0... ignore this if otherwise. :-)
NUnit 3.0 stopped changing current directory. It's a bad idea for us to do that anyway and it's a really bad idea with 3.0, when multiple assemblies in differing directories may be running at the same time.
So, assuming still it's an NUnit problem, instead of using a relative path, use TestContext.CurrentContext.TestDirectory as the location of your file.
try this:
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
In my case was fixed when I changed to this setting
The thing that helped me with such issue - I just turned off NUnit 2.x support in ReSharper settings (ReSharper -> Options... -> Tools -> Unit Testing -> NUnit).
I also turned off NUnit 2.x support and even if it has obviously nothing to do with the problem, it solved it (I have ReSharper 2017.3.20180201.111630)
We are using TestCaseSource in our tests.
So the fix for me in Rider version 2021.1.3 was to change Build-->Unit Testing-->NUnit to Test Runner
I need to come of with the approach where:
I need to run Visual Studio Unit/Integration tests in environment where visual studio will not be installed.
After lots of fiddling around i came up with one approach that is to copy MSTest.exe and related dlls into the machine and run the tests from command line.
As shown here (http://msdn.microsoft.com/en-us/library/ms182486.aspx)
But wondering is this the only solution to run visual studio tests, i.e Normal MSTests in the environment where there is no visual studio?
Any help from experienced geeks will really help :) :)
I am relatively new to unit testing and was attempting to add some code coverage to my unit tests. Yet i can't find the code coverage tab in Visual Studio 2008 in the localtestrun.testrunconfig, is there any missing Add-in or tool?
Thanks,
DMS
As I understand "Code Coverage" is available only in "bigger" editions of Visual Studio 2008. In other words, this feature is NOT available in the "Visual Studio 2008 Professional Edition".
Which edition of Visual Studio 2008 are you using ?
MSDN Link
Go to the menu Test, select Edit test run configuration for your current test run and check enable code coverage. Then perform a run and then on the test run results you can choose to display code coverage.