Visual Studio Test Explorer is an extremely useful tool to run, monitor, categorized, filter and manage the unit Test (Exploring and Managing Unit Tests Using Test Explorer in Visual Studio ) . While you can view and run the unit test from test explorer manually, Visual studio also enable feature like run the unit test automatically once the local build success. This is quite useful once we generally fix / change logic, and want to ensure the changes does not break any existing code. With this feature enabled, on build success Visual Studio execute all the test cases automatically.
There are two options to enable this feature. From the main menu, navigate to Test –> Test Settings and select “Run Tests After Build”
Must Read :
You can also enable the same by selecting “Run Test After Build” [ ] button from the Test Explorer.
When this option is selected, Visual Studio will execute the test methods automatically once build success.
Hope this help.