SonarCommunity/sonar-dotnet-tests-library — pull request #5 by skempken (2014-09-03 11:40:21+00:00)
Title: Added handling of empty unit test result

I encountered a "java.lang.IllegalArgumentException: Measure value can not be NaN" during analysis of a C# project without any unit tests. The project has been built on Team Foundation Server, thus producing an empty .trx file without any tests. When computing the share of passed tests from the empty report, the import mechanism produces a division by zero / NaN as result to be saved (which is not permitted).

I fixed this in the corresponding computation routine (UnitTestResults) as well as in UnitTestResultsImportSensor. It now does not save empty results at all.

Furthermore, some tests have been added and modified to test the expressed situation. I have tested the modified C# plugin on Sonar 4.4, it works as intended - it does not save any test results if the .trx file is empty.