I have found the following problem, while working with switch cases. R# showed me a simplification of the switch statement, which basically binds a delegate to the case label when you assign a variable.
var shape = shapeType switch
{
ShapeType.Ellipse => new Ellipse(),
ShapeType.Polygon => new Polygon(),
_ => new Rectangle()
};
The benefit of this is readability for huge switch cases, because you basically save two thirds of the lines, for assigning switches.
My problem: I really like this type of switches, since it improves the readability, but this is not considered in the Code Coverage Tool of Visual Studio (VS Enterprise 2019 - 16.4.4). Since our policy strives towards a ~90% Code Coverage, each percent is valuable.
Is there a possibility to include these Switches in the Code Coverage?