Reputation: 1
Have a question on VS 2015's new IntelliTest feature. I used the "Create IntelliTest" option on one my classes. The class implements a base class, and the methods are mostly overrides. However, IntelliTest seemingly ignored all these and generated zero tests for them. As a test, I ran IntelliTest over the base class, and it seemed to pick everthing up, but that is useless when I want to quickly flesh out Unit Tests for the class that uses the singatures of the base.
What, if anything, am I overlooking? Is there a way to run IntelliTest in a way that it will be smart enough to draft up UTs for "public override" methods?
Thanks.
Upvotes: 0
Views: 455
Reputation: 1385
You can invoke the "Run IntellITest" command on one more of the methods that you desire to generate tests for. It will automatically create a parameterized unit test and explore that to generate tests. On saving the tests, you will notice that the parameterized unit test goes into the .cs file and has the PexMethod annotation, and the generated tests go into a .g.cs file and have the PexGeneratedBy annotation.
The "Create IntelliTest" command can also be invoked on one or more methods, but it will end up only generating the parameterized unit tests. You can then invoke the Run IntelliTest command on either the parameterized unit test or on the method-under-test and it will generate the tests for you as before.
The following posts have some more information that you might find useful:
(1) https://blogs.msdn.microsoft.com/visualstudioalm/2015/08/14/intellitest-hands-on/
(3) https://blogs.msdn.microsoft.com/visualstudioalm/2015/07/05/intellitest-one-test-to-rule-them-all/
Upvotes: 1