CUITe test execution fails under VS2015 - unit-testing

Using CUITe testing framework in VS2012, I created a coded UI test. This test works as expected when right clicking the test, and hitting "run test" in VS2012.
We are in the process of migrating to VS2015, so I'm trying to go through our solutions to make sure they are behaving as expected. In this solutions case, we are running into an issue where when attempting to run a test, the output pane states:
There is no test with the specified Id (guid listed)
And no CUITe tests are run.
I have confirmed that normal coded UI tests are running in VS2015, it is specifically coded UI tests created using CUITe that are failing to run.
Don't know if anyone will have any workarounds for this, but I figured I'd give it a shot. I have additionally added all of the "Microsoft Testing" dlls to the solution in a separate folder, in order to ensure the solution is using the "specific versions" of the testing DLLs. This did not solve the problem.

The issue was due to CUITe not having been compiled/provided a build definition for VS2015.
In the current GitHub repo of CUITe (code plex URL from the original question no longer the "active link") provides a new build that addresses the issue.
Current URL for CUITe is:
https://github.com/icnocop/cuite
Issue was resolved here.

Related

second project not showing tests in test explorer

I have a solution with a test project in it, based on nUnit. All of the tests I created show in the test explorer window, I can execute, etc.
I added another unit test project to the solution, created references exactly like the first project, same nUnit version, same Platform target (Any CPU), same code structure, etc., just for a different product. But I added tests (with Test attribute) to that project and they don't show in the Test Explorer.
All of my tests in the original project still show but no tests in my new project show.
How do I get tests from multiple projects to show in the Test Explorer window?
Is the Test Explorer window tied to a specific project?
I spent a day trying to figure this out but once I posted the question, as luck would have it, I figured out the solution. I changed the nUnit version back to 3.7.1.0 and it works - both projects now show tests in the Test Explorer window.

VS2017 Enterprise Code Coverage Doesn't Do It's Job

The code coverage tool in VS2017 enterprise no longer shows what application code is covered. Whether I run it on selected tests or all tests, it shows what code in the unit tests are covered, but shows the code actually being tested at 0%. When I first started using the tool it worked just fine and showed application code coverage. I only check coverage occasionally, so I'm not sure when it broke or what I might have done to cause the issue. I'm thinking that there is something in the Registry that is causing it since I haven't been able to find anything in Tools/Options/...
I installed JetBrains dotCoverage and it does the same thing even when I exclude the unit test project from the coverage session. I've tried to repair the VS installation. My next step is uninstall/reinstall. However, unless that cleans up the registry where I think the configuration error is, it will fail to address the problem.
So any suggestions on where I can look to figure this out would be appreciated.

Get test list in MSTest via Command-Line [duplicate]

I just installed Visual Studio 2013 Premium and was having a good time playing with it and writing unit tests (using MS unit tests). However, the "Test Lists" window and some other Test related windows suddenly disappeared AND they have disappeared from the menu item
Test->Windows. In fact I remember Test->Windows having 4 items under it and now I only see two: Test Explorer, Code Coverage Results. i stress they WERE present in Visual Studio 2013. Clearly, I hit some key combination that made them disappear or something happened to make them disappear. How do I get Test List back? Please don't see they are under Tests->Windows, because for me, they are not (at least now. they were!)
Anyone else seen this? Any solutions? I tried restarting Visual Studio, rebooting.
Also, previously, under the "Test" menu, there was a Debug->"Test in Context" and a Run->"Test in Context", or something like this. It was very handy. If your cursor was with in some test, you could run just that one. I'm guessing this is related.
For all I know, these features have been "optimized" into the new test-window... a.k.a. they have been removed. Some other unit test related features are also gone (the context menu item for "create unit tests" is gone for example, yet can still be called via the command window)
Personally I think this is Microsoft's way of pushing everybody towards the Team Foundation Server but that's just my two cents.
I just had the same issue. In my case I needed to install the NUnit plugin ("Nunit test adapter"). After restarting the tests came back.
Start Developer Command Prompt:
cd to UnitTest-folder\bin\Debug which contains .dll
enter command: mstest /testcontainer:UnitTestMyTest.dll
(this creates the test-result)
in VS:
menu View / Other Windows / Test Results
manage Test Runs: window Test Runs -> connect to Test Run
browse to test-folder\bin\Debug\TestResults

VS 2015 with NUnit does not discover test cases

I am trying to use NUnit for unit testing in my code base. When I try to run my test cases using ReSharper, I get:
"System.IO.FileNotFoundException: Could not load file or assembly
'ServicesTests.dll' or one of its dependencies.
ServicesTests is my class lib for my unit tests.
I have also tried to install the NUnit Test Adapter as described here but do not see my test cases in the Test Explorer.
Any ideas on what might be happening? Below are images of my class library from the solution explorer, the test explorer, ReSharper screen.
I was able to test using Nunit3 and VS2015 with Test Explorer after I changed the type of class library I was creating. Initially I was creating a Class Library (Package) and when I switched to Class Library it worked (see image below). I am still not able to use Resharper since I am using Nunit3 beta and that is currently unsupported by Resharper.
I have a similar issue also. The best answer I've come across to solve it is try and rebuild the solution (cleans and builds), or just resort to MS Test. It's a pain to convert the tests though...
Hope this helps.
EDIT:
My NUnit runs, but no tests "exist", despite having a project, classes, and methods all correct.
ReSharper does not support running unit tests in DNX projects https://youtrack.jetbrains.com/issue/RSRP-446679.
I know this is an old question but I had a similar issue recently in VS 2017. Use the Fusion Log Viewer (aka "Assembly Binding Log Viewer") to see what assembly is failing to load:

Windows 8 App in Visual Studio 2012 - NUnit Test Adapter sees unit tests but does not run them

I have a Windows 8 Store App with two projects within the solution - one project exclusively for tests. I have added NUnit and NUnit Test Adapter (https://www.nuget.org/packages/NUnitTestAdapter/1.0.0) for this through nuget.
My tests are detected - but I cannot run or debug them. Looking at the test output window, I get the following error:
Could not find test executor with URI 'executor://nunittestexecutor/'. Make sure that the test executor is installed and supports .net runtime version 4.0.30319.34003.
I am not using resharper and I am using Visual Studio Professional 2012 Update 3 on Windows 8.1. References for the test project are as follows:
Based on my comments above, below is a workaround. Unfortunately at this stage, Windows 8.1 store Unit Test project types, using NUnit extension wouldn't work due to the different .NET targets. I tried with different Test Unit Adapters including an NUnitTestAdapterWithFramework.
It seems that the issue you haveing was occurring with standard .NET libraries targeting NUnit test adapter but the above NUnitTestAdapterWithFramework must have fixed those issue. See the Q & A section of the NUnitTestExtension
But unfortunatly it seems that this still of an issue that hasn't been fixed for Win8 Store App type Unit Testing. Pretty sure xUnit.NET also not compatible yet with different .NET target types (i,e WinRT)
So what are the options?
a. For your group, you can change them to use MSTest framework. Outcome - Problem Solved no issues.
b. Workaround "linked project". Outcome - Can't *guarantee** but this should also work.
With option 'b'
In your comment you mentioned.
but I'm still not sure what it does or how to implement a 'linked
project', do you have any more information on this? Also, as this is
for a group university project, I was hoping i wouldn't have to force
too many workarounds
When you think about it, it is not really hard work around. It is simple and I'm sure your group would be able to apply this workaround easily.
Please follow the below steps.
Create a separate class library in your solution (you can target .NET framework 4).
Then add NUnit assemblies and the NUnit test adapter as usual.
Right click on this project and select 'Add' then 'Existing Item'
Select the Win8 Store Unit Test project and locate the Unit Test file you want to add. When you add the file, make sure you select 'Add As a Link' button. Please see below.
Now rebuild the solution, close and re-open the UnitTest explorer and you should be able to run those tests.
*The reason I said can't guaranteed. I haven't really written Unit tests against Win8 App. So if your SUT (System Under Test) require special configuration it might cause issues. But I'm not sure.
Finally creating a link files are not that hard if everything works you can continue to do this until NUnit has the support for Win8 Unit Testing. Or the other option is simply change all your Unit Tests to use MSTest framework if possible.