Created
February 26, 2020 11:42
-
-
Save iainbrighton/a88ca1bcdc5dffc4cf00d047062b1006 to your computer and use it in GitHub Desktop.
OutHtml.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It 'creates paragraph with embedded new line' { | |
$expected = '<div>Embedded<br />New Line</div>'; | |
$paragraphText = 'Embedded{0}New Line' -f [System.Environment]::NewLine | |
$result = Paragraph $paragraphText | OutHtmlParagraph; | |
$result | Should BeExactly $expected; | |
} | |
It 'creates a tabular table cell with an embedded new line' { | |
$licenses = 'Standard{0}Professional{0}Enterprise' -f [System.Environment]::NewLine | |
$expected = '<td>Standard<br />Professional<br />Enterprise</td>'; | |
$newLineTable = [PSCustomObject] @{ 'Licenses' = $licenses; } | |
$table = $newLineTable | Table -Name 'Test Table' | OutHtmlTable; | |
[Xml] $html = $table.Replace('&','&'); | |
$html.OuterXml | Should Match $expected; | |
} | |
It 'creates a list table cell with an embedded new line' { | |
$licenses = 'Standard{0}Professional{0}Enterprise' -f [System.Environment]::NewLine | |
$expected = '<td>Standard<br />Professional<br />Enterprise</td>'; | |
$newLineTable = [PSCustomObject] @{ 'Licenses' = $licenses; } | |
$table = $newLineTable | Table -Name 'Test Table' | OutHtmlTable; | |
[Xml] $html = $table.Replace('&','&'); | |
$html.OuterXml | Should Match $expected; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment