@@ -17,12 +17,11 @@ public class PackageTestReport
1717
1818 if ( expectedResult != null )
1919 {
20- ReportMissingFiles ( ) ;
21-
2220 if ( actualResult . OverallResult == null )
2321 Errors . Add ( " The test-run element has no result attribute." ) ;
2422 else if ( expectedResult . OverallResult != actualResult . OverallResult )
2523 Errors . Add ( $ " Expected: Overall Result = { expectedResult . OverallResult } But was: { actualResult . OverallResult } ") ;
24+
2625 CheckCounter ( "Test Count" , expectedResult . Total , actualResult . Total ) ;
2726 CheckCounter ( "Passed" , expectedResult . Passed , actualResult . Passed ) ;
2827 CheckCounter ( "Failed" , expectedResult . Failed , actualResult . Failed ) ;
@@ -121,35 +120,6 @@ public class PackageTestReport
121120 writer . WriteLine ( " WARNING: " + warning ) ;
122121 }
123122
124- // File level errors, like missing or mal-formatted files, need to be highlighted
125- // because otherwise it's hard to detect the cause of the problem without debugging.
126- // This method finds and reports that type of error.
127- private void ReportMissingFiles ( )
128- {
129- // Start with all the top-level test suites. Note that files that
130- // cannot be found show up as Unknown as do unsupported file types.
131- var suites = Result . Xml . SelectNodes (
132- "//test-suite[@type='Unknown'] | //test-suite[@type='Project'] | //test-suite[@type='Assembly']" ) ;
133-
134- // If there is no top-level suite, it generally means the file format could not be interpreted
135- if ( suites . Count == 0 )
136- Errors . Add ( " No top-level suites! Possible empty command-line or misformed project." ) ;
137-
138- foreach ( XmlNode suite in suites )
139- {
140- // Narrow down to the specific failures we want
141- string runState = GetAttribute ( suite , "runstate" ) ;
142- string suiteResult = GetAttribute ( suite , "result" ) ;
143- string label = GetAttribute ( suite , "label" ) ;
144- string site = suite . Attributes [ "site" ] ? . Value ?? "Test" ;
145- if ( runState == "NotRunnable" || suiteResult == "Failed" && site == "Test" && ( label == "Invalid" || label == "Error" ) )
146- {
147- string message = suite . SelectSingleNode ( "reason/message" ) ? . InnerText ;
148- Errors . Add ( $ " { message } ") ;
149- }
150- }
151- }
152-
153123 private void CheckCounter ( string label , int expected , int actual )
154124 {
155125 // If expected value of counter is negative, it means no check is needed
0 commit comments