File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -539,7 +539,13 @@ function Write-NUnit3TestCaseAttributes {
539
539
}
540
540
541
541
function Write-NUnit3OutputElement ($Output , [System.Xml.XmlWriter ] $XmlWriter ) {
542
- $outputString = @ (foreach ($o in $Output ) { $o.ToString () }) -join [System.Environment ]::NewLine
542
+ $outputString = @ (foreach ($o in $Output ) {
543
+ if ($null -eq $o ) {
544
+ [string ]::Empty
545
+ } else {
546
+ $o.ToString ()
547
+ }
548
+ }) -join [System.Environment ]::NewLine
543
549
544
550
$XmlWriter.WriteStartElement (' output' )
545
551
$XmlWriter.WriteCData ($outputString )
Original file line number Diff line number Diff line change @@ -409,6 +409,8 @@ i -PassThru:$PassThru {
409
409
}
410
410
It ' Test' {
411
411
' test output'
412
+ $null # Should not throw but leave blank line
413
+ 123
412
414
$true | Should - Be $true
413
415
}
414
416
}
@@ -423,7 +425,10 @@ i -PassThru:$PassThru {
423
425
424
426
$xmlTest = $xmlDescribe .' test-case'
425
427
$xmlTest.name | Verify- Equal ' Describe.Test'
426
- $xmlTest.output .' #cdata-section' | Verify- Equal ' test output'
428
+ $message = $xmlTest.output .' #cdata-section' -split " `n "
429
+ $message [0 ] | Verify- Equal ' test output'
430
+ $message [1 ] | Verify- Equal ' '
431
+ $message [2 ] | Verify- Equal ' 123'
427
432
}
428
433
429
434
t ' should add site-attribute to identity failure location' {
You can’t perform that action at this time.
0 commit comments