c++ unit test/mock framework integrated into visual studio 2012 - c++

I want to use unit tests in VS 2012 in c++. VS allows to write unit tests, run them and see the output in test explorer window. Unfortunately it seems that VS lacks a mock framework. Do You know how to integrate for example Google Test/Mock framework into VS, so that I can still see the test results in test explorer window?

Related

UWP Unit Tests Don't Show Up in Rider

I have a solution with two unit testing projects. One is for .NET and the other is for UWP. The .NET Framework and .NET Core tests show up in Rider but the UWP tests don't show up. They show up in Visual Studio. You can see the project here. It appears that dotCover is supposed to support UWP. I assume that Rider uses the same engine. Also, I opened dotCover and found my app unit testing app among the packages but it doesn't pick up any of the tests either. I'm using MS Test but can switch if need be.
This is what I see in dotCover:
Does Rider support UWP for unit testing? If not, can I do this with dotCover? What am I doing wrong?
Right now, even ReSharper does not support discovering UWP tests in Visual Studio 2019 due to a lack of API. That's why it does not work in Rider as well.
However, we've implemented our own test runner to run UWP tests https://youtrack.jetbrains.com/issue/RSRP-473827, and it will be available in upcoming releases in both ReSharper and Rider.

How to install Microsoft Unit Testing Framework for C++?

According to the documentation provided by Microsoft's Write unit tests for C/C++ in Visual Studio Visual Studio includes 4 unit testing framework for C++ by default without any extra installs required. However when I try to add a unit test framework only Google Test is shown. In my second screenshot I show that I have these framework installed. How do I get Microsoft Unit Testing Framework for C++?

Angular (Typescript) Unit Testing - ASP.Net Core MVC SPA

I am developing a project which started life as an ASP.Net Core MVC SPA Template in Visual Studio 2015. I used the Visual Studio Karma Test Adapter with no problems for my Angular (Typescript) unit testing, but no matter what I tried I could not get NUnit to recognise my C# unit tests for the Web API and early Domain Model code. I tried to add a separate Test Project with no success and I also created unit test files within the same, single, project with no success.
At some point I knew I should migrate the code to Visual Studio 2017, as I feel that the new IDE will prove to be beneficial as the project develops, so I thought I would do it now and see if it solves my unit testing problems. Visual Studio's migration process didn't go well so I decided to start from scratch again.
I ran dotnet new angular to create a clean solution which I opened in VS 2017. It appears that the Visual Studio Karma Test Adapter does not work with VS 2017 yet, so for the Typescript (Jasmine) testing that left me with Chutzpah. No matter what I try I cannot write the simplest of Jasmine tests and have the Visual Studio Test Explorer recognise it (let alone run the test). I haven't even begun to look at the C# Unit Testing yet.
Can anyone else get a Jasmine Unit Test to be recognised and run in the VS Test Explorer from a clean dotnet new angular solution, I would be very grateful for some advise.

C++ unit testing with VS test professional

Does any one know if I can test native code in VS Test 2010?
As of VS2010, native C++ unit testing is not directly supported by Visual Studio. See MSDN, specifically:
You cannot have test projects with unit tests that use unmanaged C++.
You can still do native C++ unit testing with Visual Studio, but it won't be as integrated as other VS features. See this SO answer for a number of native unit testing frameworks and libraries. I have not used any of those, so I cannot give any guidance there.
I would bite the bullet, download Boost and get the test suite compiled. Once you get into it, it's as easy as VS tests.

Switching from MSTest to another unit test framework in VS 2010

Visual Studio 2010 offers a lot of comfortable tools for unit testing via its built in test runner. Unfortunately we can't use MSTest for our unmanaged c++ codebase. Is it possible to switch from MSTest to e.g. Google.Test and have it integrated with the built in Visual Studio test runner?
Thanks in advance!
I have not seen anyway to integrate another unit testing framework into the VS test runner.
You might look at some VS add-in test runners, testdriven.net and gallio are two.
Kindness,
Dan
It's possible to use gtest (google test) in VS2010 and have it integrated with the IDE thanks to the extension: GoogleTestAddin
You can be interested by this similar thread: Viewing Google Test results within Visual Studio