I am using Visual Studio 2017 Professional and I really want to run tests after build, a feature is only available in Visual Studio Enterprise and currently in Visual Studio 2019 Professional Preview as well. Visual Studio 2019's IntelliSense doesn't do "code completion" well, so I still mainly use Visual Studio 2017.
A work-around to run tests after build in VS 2017 is to run the test from the command line using dotnet vstest
.
Simply create a batch file to run dotnet vstest [Your Test Project].dll
and add to Project Properties > Build Events > Post-build event command line: call $(ProjectDir)YourBatchFile.bat > Run the post-build event: On successful build
.
Below is a sample Output
after the build:
