I am using visual studio 2017. I have a set of unit test that I have run and used before.
Right now when ever I run all of these tests using menu Test -> Run -> All Tests, nothing happens. Nothing is printed on Output windows, no error is thrown and everything stays the same. Even the project doesn't build like it before unit tests are run. Its like I haven't clicked anything at all. I can see all my tests on Test explorer window.
There is no code to show since its not a code issue.
What can be the reason behind this issue?
Related
Neither the integrated test environment nor Resharper won't run any unit tests.
When starting Visual Studio the Test Output Pane shows 10+ lines stating:
An exception was thrown while initializing part "Microsoft.VisualStudio.TestWindow.Controller.TestPlatformProvider".
This is what I've tried so far:
Clear folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Create a simple test project with one class library, one class and one test library containing one unit test for that class
Uninstallation and new installation of Visual Studio 2015
All actions didn't fix the problem. Even the simple test won't run.
Running tests from command line using MSTest does work.
Ensure that your anti-virus programs are not quarantining Visual Studio components.
I had this problem when our corporate IT department changed our Sophos Protection Quarantine policy. VS2015 Unit testing stopped working for everyone, with a similar error.
I migrated from Visual Studio 2010 to Visual Studio 2013 Express. In VS2010, the MSTest.exe used to run the tests with NAnt. As in VS2013 no longer has the MSTeste.exe, I'm using VSTest.Console.exe.
The problem is that in a test project, the VSTest.Console.exe reports that test run successfully, but does not terminate or continue the process. It seems that is locked.
In another test project works perfectly. Have rode by NAnt inside VS2013 Express and MS-Dos and got the same error. Because one ends and the other not?
VSTest not working:
vstest.console.exe C:\Daniel\DriveD\dotnet\IntegradorWS\Integrador.Senior.Tests\bin\x86\Release\Integrador.Senior.Tests.dll /Logger:trx
Image for MS-Dos:
VSTest working:
vstest.console.exe C:\Daniel\DriveD\dotnet\IntegradorWS\Integrador.Modelo.Tests\bin\x86\Release\Integrador.Modelo.Tests.dll /Logger:trx
Image for MS-Dos:
Are these Tests also Testing a GUI? Is there a MessageBox or another controll that requires a user interaktion? If yes, you should abstract the Controll, i.e. the MessageBox, into one MessageBox-Adapter thas is easy to be Mocked into your corresponding test.
This question is very similar to this one, but I'm experiencing it in Visual Studio 2010 SP1. I am running my tests locally (there is no remote test controller).
I recently started working on a client's .NET 4.0 project. It has a suite of Visual Studio Unit Testing Framework unit tests. When I launch the unit tests, IIS Express automatically starts. I can run the unit tests dozens of times without any issues to see whether they pass or fail. However, when I attempt to debug the unit tests (by right-clicking on a test in Test View and clicking Debug Selection), it almost always fails with the following error message:
Error 3/19/2014 2:42:44 PM Failed to queue test run 'ThoughtProcess#HOSTNAME 2014-03-19-14:42:40': Process with an Id of [12345] is not running.
I say "almost" because every 20 or so clean starts of VS, it will successfully attach the debugger. But I haven't been able to consistently reproduce this behavior.
I tried the suggestions from the Visual Studio 2012 post, but those didn't work in my situation. Has anyone else encountered this issue?
In the spirit of this xkcd comic, I did find a solution to this issue by installing ReSharper and using its test runner instead of the built-in Visual Studio test runner.
The ReSharper runner consistently and repeatably lets me run and debug unit tests without any issues. I'm still not sure that I understand the underlying cause of why the VS runner can't debug, but hopefully this will save someone else future frustration.
I hope some one has an idea why Ctrl+R, T is not working in VS2013 anymore.
Previously (VS2012) when I hit the shortcut, and I had my cursor in a test, it only runs the test.
At the website of Microsoft it says exactly how I should expect it should work.
It says:
Ctrl + R, then press T
This runs the tests in the current scope. That is, it runs the
current test method, all the tests in the current test class, or
all the tests in the namespace, respectively.
Source: http://msdn.microsoft.com/en-us/library/vstudio/ms182470.aspx#RunTestsFromTestProject
However in VS2013 it runs all the tests in the current file.
When I use the Test Explorer it runs correctly the only selected test...
I have the following extensions installed:
Productivity Power Tools 2013
Xunit.net runner for Visual Studio 2012 and 2013
Chutzpah Test Adapter for the Test Explorer
Chutzpah Test Runner Context Menu Extension
Ok, its a bug in the xUnit testrunner.
I tested with NUnit and it works as expected.
On xUnit.net is a bugreport.
Link: http://xunit.codeplex.com/workitem/9901
Edit:
Issue is solved in version 0.99.2
I'm new to NUnit and I just download it today and I can't get it working with visual studio. (I'm new to Visual Studio as well)
I'm following TekPub's Mastering C# 4.0 tutorial.
Screenshot: Something is missing within the red circle area. There should be some "green thing" on the side that let you double click on it and run the NUnit test.
http://dl.dropbox.com/u/20422001/NunitMissing.jpg
As you can see on the above screenshot, the NUnit seems not working....
Did I miss something? Please advice. Thanks
EDIT
This is how it SHOULD look like. I took a screenshot from the video tutorial:
http://dl.dropbox.com/u/20422001/nunit.jpg
and here is the project files:
http://dl.dropbox.com/u/20422001/MasteringCSharp.rar
As you can see, I don't have "Unit Test" Tab and "Unit Test Session"...
You aren't doing anything wrong. Out of the box, NUnit doesn't integrate directly with Visual Studio. The screenshot from the video appears to be using Resharper's test runner.
Typically testing with NUnit requires you to compile your test project and then load it into the NUnit GUI (nunit.exe) where the tests can be run from there. When using the NUnit GUI, the project will reload anytime the assembly is recompiled. (I sometimes prefer having this in a separate process as it doesn't tie up Visual Studio's UI, but that's a matter of preference.)
The added advantage of using a third party test runner like Resharper, TestDriven.net, Galileo, etc is that it allows you to run or debug the tests directly from within the IDE. You can accomplish the same thing using NUnit by configuring Visual Studio to attach to NUnit and debug your tests from the external process. This post shows you how.
I haven't seen that particular video, but it sounds like you need an NUnit test runner for Visual Studio.
Check out the following:
Visual NUnit 2010 - free!
TestDriven.net
ReSharper
That my friend is JetBrains' Resharper - it's a paid add-in to Visual Studio that allows you to run tests from within the IDE. Highly recommended if you're working for a prolonged period in VS.
Of course since you're just starting out, you could use the NUnit GUI to run your tests. You can also set it to run tests after each build.
Tools > Settings > Test Loader > Assembly Reload. Check "Re-Run last tests run". Apply changes