-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BeforeAll { | ||
$Images = @{ | ||
"Main_Logo" = "Diagrammer.png" | ||
"ForestRoot" = "RootDomain.png" | ||
} | ||
$SiteSubnets = @("192.68.5.0/24", "192.68.7.0/24", "10.0.0.0/24") | ||
$HTMLMultiColumn = Get-DiaHTMLTable -Rows $SiteSubnets -Align "Center" -ColumnSize 2 -MultiColunms | ||
$HTMLSingleColumn = Get-DiaHTMLTable -Rows $SiteSubnets -Align "Center" | ||
$HTMLSingleColumnIcon = Get-DiaHTMLTable -Rows $SiteSubnets -Align "Center" -Logo "ForestRoot" -ImagesObj $Images | ||
} | ||
|
||
Describe "Get-DiaHTMLTable" { | ||
It "Returns a single column HMLT table" { | ||
$HTMLSingleColumn | Should -BeExactly '<TABLE STYLE="ROUNDED" border="0" cellborder="0" cellpadding="5"><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">192.68.5.0/24</FONT></B></TD></TR><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">192.68.7.0/24</FONT></B></TD></TR><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">10.0.0.0/24</FONT></B></TD></TR></TABLE>' | ||
} | ||
It "Returns a multi column HMLT table" { | ||
$HTMLMultiColumn | Should -BeExactly '<TABLE border="0" cellborder="0" cellpadding="5"><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14">192.68.5.0/24</FONT></TD><TD align="Center" colspan="1"><FONT POINT-SIZE="14">192.68.7.0/24</FONT></TD></TR><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14">10.0.0.0/24</FONT></TD></TR></TABLE>' | ||
} | ||
It "Returns a multi column HMLT table with single Icon" { | ||
$HTMLSingleColumnIcon | Should -BeExactly '<TABLE STYLE="ROUNDED" border="0" cellborder="0" cellpadding="5"><TR><TD fixedsize="true" width="80" height="80" ALIGN="Center" colspan="1" rowspan="4"><img src="RootDomain.png"/></TD></TR><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">192.68.5.0/24</FONT></B></TD></TR><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">192.68.7.0/24</FONT></B></TD></TR><TR><TD valign="top" align="Center" colspan="2"><B><FONT POINT-SIZE="14">10.0.0.0/24</FONT></B></TD></TR></TABLE>' | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BeforeAll { | ||
$Logo = Join-Path $TestsFolder "Logo.png" | ||
$ImgProperties = Get-DiaImagePercent -ImageInput $Logo | ||
} | ||
|
||
Describe "Get-DiaImagePercent" { | ||
It "Returns image Height" { | ||
$ImgProperties.Height | Should -Be 225 | ||
} | ||
It "Returns image Width" { | ||
$ImgProperties.Width | Should -Be 225 | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BeforeAll { | ||
$Images = @{ | ||
"Main_Logo" = "Diagrammer.png" | ||
"ForestRoot" = "RootDomain.png" | ||
} | ||
$DC = "Server-DC-01v" | ||
$DCRows = @{ | ||
Memory = "4GB" | ||
CPU = "2" | ||
} | ||
$HTMLOutPut = Get-DiaNodeIcon -Name $DC -IconType "ForestRoot" -Align "Center" -Rows $DCRows -ImagesObj $Images | ||
$HTMLOutPutDebug = Get-DiaNodeIcon -Name $DC -IconType "ForestRoot" -Align "Center" -Rows $DCRows -ImagesObj $Images -IconDebug $true | ||
} | ||
|
||
Describe "Get-DiaNodeIcon" { | ||
It "Returns a HMLT table" { | ||
$HTMLOutPut | Should -BeExactly "<TABLE border='0' cellborder='0' cellspacing='5' cellpadding='0'><TR><TD ALIGN='Center' colspan='1'><img src='RootDomain.png'/></TD></TR><TR><TD align='Center'><B>Server-DC-01v</B></TD></TR><TR><TD align='Center' colspan='1'><FONT POINT-SIZE='14'>Memory: 4GB</FONT></TD></TR> <TR><TD align='Center' colspan='1'><FONT POINT-SIZE='14'>CPU: 2</FONT></TD></TR></TABLE>" | ||
} | ||
It "Returns a HMLT table with the IMG tag" { | ||
$HTMLOutPut | Should -Match "<img src='RootDomain.png'/>" | ||
} | ||
It "Returns a HMLT table with red colored table" { | ||
$HTMLOutPutDebug | Should -Match "color='red'" | ||
} | ||
It "Returns a HMLT table without the IMG tag" { | ||
$HTMLOutPutDebug | Should -Not -Match "<img src='RootDomain.png'/>" | ||
} | ||
} |