Running Visual Studio Test project from outside - c#

I am trying to run a Visual Studio 2012 solution with a normal c# dll project and a Unit test project(referencing the c# project dll) from a windows 8 app/ another c# project.
How do I trigger the run of the unit tests from another visual studio project?
Is there any way to trigger with a powershell script ?

mstest.exe is the command line test runner.
It is documented on MSDN: http://msdn.microsoft.com/en-us/library/jj155804.aspx
I see no reason this will not work from PowerShell.

Related

Setup exe for Unit Test Project

I have a Unit test project in Visual Studio C# and I am trying to make it a standalone exe. I have used Visual Studio Installer for it. On installing exe, i get the error that dlls cannot work.
1-Is it ok to make exe for Unit Test Project?
2- How do I package the dlls in setup exe or setup msi?

C# code written in Visual Studio won't run in Visual Studio Code

I am trying to run a .NET Core Application in Visual Studio Code that was created in Visual Studio 2019. I'm having trouble with the dotnet run part, though. It keeps giving me this error:
Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'.
The current OutputType is 'Exe'.
I have tried dotnet restore, dotnet build, dotnet clean, etc. Any suggestions on how to get this to run?
Terminal Output
I am not sure if this is your problem, but I experienced something similar recently. Some applications coded in VS will not run in VS Code. VS 2019 utilizes IIS Express to run applcations on localhost. I do not believe VS Code has this ability as a text editor, compared to the power of VS 2019 as a IDE.

Running unit tests from a command line

I'm working on a suite of application that interact with many websites and api's. I have created unit tests that test this code.
As it's beyond my control, I want to know as soon as sites / api's change and the code stops working so I can fix and would like to run the tests periodically against the assemblies running. How can I run the tests outside of VS?
I'd like the option of testing on Linux mono too.
You can use MsTest from the command line:
Example:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\mstest" /testcontainer:C:\MyTestProject\bin\debug\MyTestProject.dll /resultsfile:C:\TestResults\results.trx
(Full list of command line switches on the link above)
This is set to Visual Studio 2015, for 2017 just make sure you have the right version number, I believe 15.0
MSTest has been deprecated, you'll want to invoke VSTest from the command line

How to run test projects in orchard cms?

I have been trying to run my own test method in orchard cms , but visual studio does not detect test projects in the solution.is there any specific method to run tests in orchard?or this is a problem with visual studio itself not detecting the test classes.
thanks for your help.
Orchard uses NUnit tests, so you should install NUnit in your Visual Studio to be able to run the tests.

VSTest.Console.exe not finished after test run successfully

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.

Categories