Create IntelliTest in Visual Studio  2015 – another way of start writing Smart Unit Test

Create IntelliTest in Visual Studio 2015 – another way of start writing Smart Unit Test

IntelliTest helps us to generates Unit Test automatically that give maximum of code coverage.  In one of our previous post – Write Unit Test Automatically using IntelliTest in Visual Studio 2015 , we have learned about IntelliTest, how to use it and how it help to increase the code coverage with a very minimum effort. We have seen it, in a way of using “Run IntelliTest” command, which actually generate unit test for all methods within the specified class. In case you want to generate for any specific method or even start with a new one, you can use “Create IntelliTest” option.

They works in a exactly similar way how “Run IntellTest” works. the only difference it’s generate the unit test with test data for selected method. Also with Run IntelliTest, it first generate the test methods, shows them in Intellitest Windows, and then we can save them as project. Whereas, for Create IntelliTest, it creates the test project firsts and then we need to run the “Run IntelliTest” to execute the created test methods.

image

Must Read :

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

 

Select any of the test methods, Right Click –> “Create IntelliTest”  .

Create IntelliTest
This will bring the similar dialog window like “Create UnitTest” to enter initial project information

Create IntelliTest Project

If you continue with default select values, and click Ok, Visual Studio would generate Test Project and add it to the solution .   With “Run intelliTest”  we need to save the the test results to create the projects

 

IntelliTest Project Created

Now onward, everything would be same with what we have covered with Write Unit Test Automatically using IntelliTest in Visual Studio 2015  post.

 

You can also use other Unit Test Framework with IntelliTest.  Install them as Visual Studio extension and then you should be able to select them from the “Test Framework” dropdown.

Adding New Test Framwork for IntelliTest

 

XUnit Test Framework with IntelliTest

When Visual Studio creates the projects, it automatically takes care of assigning the reference assembly for the type of test framework selected.

For an example, following test project was create using IntelliTest and xUnit test framework.

XUnit Test Framework with IntelliTest Project

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.

3 Comments to “Create IntelliTest in Visual Studio 2015 – another way of start writing Smart Unit Test”

Comments are closed.