+"@
+
+ foreach ($result in $TestResults) {
+ $html += @"
+
+
$($result.Configuration.Run.Path)
+"@
+
+ foreach ($test in $result.Tests) {
+ $cssClass = switch ($test.Result) {
+ "Passed" { "test-passed" }
+ "Failed" { "test-failed" }
+ "Skipped" { "test-skipped" }
+ default { "test-item" }
+ }
+
+ $html += @"
+
+
$($test.Name)
+
[$($test.Result)]
+"@
+
+ if ($test.Result -eq "Failed" -and $test.ErrorRecord) {
+ $html += @"
+
+ Error: $($test.ErrorRecord.Exception.Message)
+
+"@
+ }
+
+ $html += "
"
+ }
+
+ $html += "