Run Tests After Build – Automatically Running Unit Test After Build Success in Visual Studio

Run Tests After Build – Automatically Running Unit Test After Build Success in Visual Studio

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”

image

 

Must Read :

How to write your very first Unit Test in Visual Studio using MSTest Framework easily ?

Exploring and Managing Unit Tests Using Test Explorer in Visual Studio

You can also enable the same by selecting  “Run Test After Build”  [ image ] button from the Test Explorer.

image

 

When this option is selected, Visual Studio will execute the test methods automatically once build success.

Hope this help.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 Comments to “Run Tests After Build – Automatically Running Unit Test After Build Success in Visual Studio”

Comments are closed.