I recently "upgraded" from Visual Studio 2012 to 2017, and now a number of tests which pass when run in 2012, fail in 2017. Application-specific Assertions fail and I am also getting the following exceptions:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test (needless to say, a restart does not resolve the issue)
System.InvalidOperationException: Operation is not valid due to the current state of the object.
All code, options, and settings are identical in both environments. I am using Microsoft's testing framework, not NUnit, XUnit, etc. The code is in VB.Net. Any guidance would be appreciated. Thanks.
The option to use Fakes Assemblies isn't available in the Professional version. We will need to upgrade to the Enterprise Edition, or continue using 2012.
Related
I want to find code coverage for methods in dlls to be tested.
Through https://learn.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2017#requirements I understand that there should be menu for CodeCoverage in Test Explorer for VS2017. which I didin't find for my installed visual studio..
So what is process to find code coverage for VS 2017 professional version 15.8
Code coverage is a Enterprise feature that is not available for Professional version.
Duplicate of question "Analyze Code Coverage" option missing in Visual Studio 2017 Professional
See version feature comparison here https://visualstudio.microsoft.com/vs/compare/
We have Team Foundation Server 2013 installed with Visual Studio Professional 2015 and I've been able to get continuous integration builds working using the TfvcTemplate.12.xaml build process template and the "/tv:14.0" MSBuild argument. However, I can't seem to find a way to tell TFS to use the 2015 Unit Test suite.
This post Build VS 2015 Solution w/ Unit Tests on TFS 2013 Team Build worked around the problem by installing VS 2013 on the build server, but that means that the build server would use the 2013 testing framework rather than the version used by the developer.
Another option is to use an older build process template that uses MSTest, which supports the "ToolPath" parameter, but MSTest appears to be deprecated (MSTest V2). BTW, I tried using the MSTest V2 NuGet packages, but that didn't have any effect on the framework used by TFS, which made sense once I thought about it.
I assume that there should be some way to tie in a third-party testing framework, but the examples I've found use the older build process template.
Has anyone else found a solution for this?
If you need your test agent or test controller to work with TFS 2013,
use Agents for Microsoft Visual Studio 2013 Update 5 and
configure the test controller.
Source Link: Install and configure test agents
This is the official recommended practices, we don't suggest you to use some third-party testing framework for handling your situation (not sure if there were).
Besides just as MrHinsh commented, we encourage you to move to new web-based build system which is more excellent. For the detail benefit of VNext builds, you could refer to this article Why You Should Switch to Build VNext
Using the C++ unit testing framework with Visual Studio 2013 Professional, one can write unit tests and run them from within the IDE, but in order to generate any coverage reports, apparently, one needs to have the Premium or Ultimate edition of Visual Studio.
Is it possible to get code coverage reports with the Professional edition, preferably without installing any third party tools? If not, what alternate options exist for people who are not using the more expensive editions of the IDE?
Please note that it's possible to generate the coverage data by using command line tools, but I am unable to find a way to look at the results. For the sake of reference, here are the steps for command line generation of the coverage statistics:
Build the code to test with with /PROFILE linker switch
Run vsinstr /coverage <binaryName> to instrument the code; make sure that you are inside VS 2013 command prompt
Run start vsperfmon -coverage -output:results to run the profiler
Run your unit tests
Stop the profiler by running vsperfcmd -shutdown
The above will give you a results.coverage file, with no way to view it without the Premium or Ultimate editions as far as I know.
With VS2013 Professional you are out of luck if you want to do it without third party tools Requirements: Visual Studio Ultimate, Visual Studio Premium (http://msdn.microsoft.com/en-us/library/dd537628.aspx). From what I understand you already managed to generate your *.coverage file and you are having problems opening it. Visual Coverage (https://github.com/jsargiot/visual-coverage) tool can help you with that, its very simple to use and it is opensource. If you would like to find more alternatives, see another SO thread: Viewing Code Coverage Results outside of Visual studio. The tools are meant for C# coverage files but from what I understand there should not be any difference.
If you are ready to use third-party libraries, you can use OpenCPPCoverage. It works for me like a command line app. But I couldn't run it like a visual studio plugin at Professional Visual Studio 2013.
One possible way you could get coverage data is by running an instrumentation toolkit on your Unit Test program. The instrumentation tool will tell you how much was covered during execution and you can easily relate this data back to how much coverage your unit tests give you. I did this with an XCode project and OpenPAT but you could do the same with any Visual Studio friendly toolkit.
Is there a project with similar goals as Specflow is to cucumber in Visual Studio, but for cucumberjs?
I'm considering a unit testing / bdd framework for Visual Studio. Cucumberjs seems like the obvious choice as I am using Specflow to test the c#. However cucumberjs requires nodejs to be installed.
Chutzpah runs things like jasmine, qunit etc in Visual Studio. Is there a way to do the same for cucumberjs? Perhaps nodejstools for visualstudio with a mixture of something else?
There is a Feature request: Cucumber-js support for Chutzpah, but it's work in progress.
(Chutzpah was moved to github, so the issue was lost)
A new Chutzpah feature request on github for cucumber-js support
There is an interview with a cucumber core member saying (below) which sounds promising:
"Support for Cucumber.js is being added to popular IDEs like Jetbrains
Webstorm 8 and Visual Studio."
As per David Leitner's reply, I've created a step-by-step guide to setting up cucumberjs in Visual Studio.
http://blogs.endjin.com/2015/10/step-by-step-guide-to-setting-up-cucumberjs-in-visual-studio-2015/
I've done this by using the Visual Studio Task Runner Explorer. (You have to add it if you use VS 2013, with 2015 it's already included.)
This Extension is a task runner for Grunt and Gulp directly within Visual Studio 2013. It is now possible to define a Grunt task, like this one which runs your cucumberjs Features.
Is there any support for unit testing in Visual Studio 2005? After googling for some time, I found out that we can do unit testing with Visual Studio Team System, but I do not have it.
I cannot install NUnit also because of some stupid rules of my organization. Does anyone knows how to do unit testing in Visual Studio?
Many Thanks
If you can't use NUnit (and presumably MBUnit etc.), then you have two options: upgrade to VS2005 Team System or VS2008 Professional. Sure, it will possibly cost money, but if challenged when presenting your case to the manager, point out that their "policy" is what's costing them the money.
If you upgrade to VS 2008, they changed their stance and included unit testing in the non Team suite level versions of the IDE.