I recently created a unit test project(.net framework) in my project(.net framework 4.8). I run my tests with visual studio enter image description here. now wanna add a stage to my ci/cd on gitlab to run my tests. I know how to do that in .net (dotnet test) but I don't know how to run my tests for .net framework with command line
I'll be happy to know your solutions. Tnx
CodePudding user response:
For .net framework you should get familiar with MSBuild. If you are using MSTest you also need to know VSTestConsole. Not too hard! Here is a minimal GitLab CI config for a .Net framework solution.
Also check here for more detials.
CodePudding user response:
The VSTest.Console.exe tool can be used to run unit tests. This is equivalent to using the Visual Studio Test Explorer window.
VSTest.Console.exe is installed with Visual Studio. It is also available in the Microsoft.TestPlatform NuGet package.
(As a note for the benefit of users of Azure DevOps, Azure DevOps pipelines has a Visual Studio Test Platform Installer task that will install the test runner. The Azure DevOps task uses the NuGet package.)