Visaul Studio 2015: Code Lens Unit Test Attribution bug
24 Aug 2015I am currently working on a legacy application that has recently had a “solution” upgrade to work with Visual Studio 2015. During the course of my work I have encountered minor Code Lens attribution bug.
The bug essentially attributes test results of a child class, to the base class from which it is inherited. The test results are then propagated up the class hierarchy to all classes which inherit from the base class.
Example:
-
Create Unit Tests for new Attribute Figure: Unit Tests for RemoteRequireAttribute
-
Create ActionFilter that inherits from RequireHttpsAttribute | ActionFilterAttribute and implement functionality. Figure: RemoteRequireHttpsAttribute class signature
-
Execute Tests. All Passing Figure: Passing Unit Tests
-
View another class that inherits from ActionAttribute. VS2015 Code lens now shows 5 of 5 tests passing. Figure: 5 of 5 passing tests
-
Closer inspection of the tests shows that the are not related to this class, other than the base inherited classes. Figure: 5 of 5 passing tests are all for RemoteRequireHttpsAttribute ActionFilter.
For those of you who are wondering what my system looks like:
- Surface Pro 3 - Max specs.
- Windows 8.1 Fully patched and at the latest version
- Domain Joined
- .Net 2 through 4.6 installed and fully patched to the latest versions
- VS2013 and VS2015 are both installed and fully patched.