Code coverage is not calculated for some layers in the .NET Web API project

Web API project consists of different layers. API layer, application layer, domain layer, data layer. I have created unit tests for each layer. and they are configured to run during the Azure DevOps CI pipeline and publish the code coverage. All the unit tests are passing. but only API layer coverage is not listed in the code coverage analysis in Sonarcloud, only a ‘-’ is denoted for them. I have not excluded any layer from the analysis either. Any idea?

Hi,

Welcome to the community!

The first and last projects in your list have been detected as test projects. That’s why they have - for lines of code, coverage and duplications.

To change that, check here.

 
HTH,
Ann

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.