Tests/Get-DiaHtmlSubGraph.Tests.ps1

BeforeAll {
    . $PSScriptRoot\_InitializeTests.ps1
    . $ProjectRoot\SRC\private\Get-DiaHtmlSubGraph.ps1
}

Describe Get-DiaHtmlSubGraph {
    BeforeAll {
        $Images = @{
            "Main_Logo" = "Diagrammer.png"
            "DomainController" = "AD_DC.png"
            "Subnets" = "AD_Subnets.png"
        }
        $DCsArray = @("Server-dc-01v", "Server-dc-02v", "Server-dc-03v", "Server-dc-04v", "Server-dc-05v", "Server-dc-06v")
        $SubnetsArray = @("192.168.5.0", "192.168.7.0", "192.168.9.0", "172.16.9.0", "172.16.18.0", "10.10.8.0")

        $DCNodes = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $DCsArray -columnSize 3 -Align 'Center' -iconType "DomainController" -MultiIcon
        $SubnetsNodes = Get-DiaHTMLNodeTable -ImagesObj $Images -inputObject $SubnetsArray -columnSize 3 -Align 'Center' -iconType "Subnets" -MultiIcon

        $TableObjects = @($DCNodes, $SubnetsNodes)

        $HTMLSubgraphLogoDown = Get-DiaHtmlSubGraph -ImagesObj $Images -TableArray $TableObjects -Align "Center"  -IconType 'Main_Logo' -columnSize 2 -Label 'SubGraph Test' -LabelPos 'down'
        $HTMLSubgraphLogoDownDebug = Get-DiaHtmlSubGraph -ImagesObj $Images -TableArray $TableObjects -Align "Center"  -IconType 'Main_Logo' -columnSize 2 -Label 'SubGraph Test' -LabelPos 'down' -IconDebug $true

        $HTMLSubgraphLogoTop = Get-DiaHtmlSubGraph -ImagesObj $Images -TableArray $TableObjects -Align "Center"  -IconType 'Main_Logo' -columnSize 2 -Label 'SubGraph Test' -LabelPos 'top'
        $HTMLSubgraphLogoTopDebug = Get-DiaHtmlSubGraph -ImagesObj $Images -TableArray $TableObjects -Align "Center"  -IconType 'Main_Logo' -columnSize 2 -Label 'SubGraph Test' -LabelPos 'top' -IconDebug $true

    }

    It "Should return a multiple column HMLT table with Label and Logo at botton" {
        $HTMLSubgraphLogoDown | Should -BeExactly '<TABLE COLOR="#000000" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-01v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-01v</B></FONT></TD><TD PORT="Server-dc-02v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-02v</B></FONT></TD><TD PORT="Server-dc-03v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-03v</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-04v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-04v</B></FONT></TD><TD PORT="Server-dc-05v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-05v</B></FONT></TD><TD PORT="Server-dc-06v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-06v</B></FONT></TD></TR></TABLE></FONT></TD><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="192.168.5.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.5.0</B></FONT></TD><TD PORT="192.168.7.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.7.0</B></FONT></TD><TD PORT="192.168.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.9.0</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="172.16.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.9.0</B></FONT></TD><TD PORT="172.16.18.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.18.0</B></FONT></TD><TD PORT="10.10.8.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>10.10.8.0</B></FONT></TD></TR></TABLE></FONT></TD></TR><TR><TD valign="BOTTOM" ALIGN="Center" colspan="2" fixedsize="true" width="40" height="40"><IMG src="Diagrammer.png"></IMG></TD></TR><TR><TD valign="TOP" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Test</B></FONT></TD></TR></TABLE>'
    }
    It "Should return a multiple column HMLT table with Label and Logo at botton" {
        $HTMLSubgraphLogoDownDebug | Should -BeExactly '<TABLE COLOR="red" border="1" cellborder="1" cellpadding="5"><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-01v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-01v</B></FONT></TD><TD PORT="Server-dc-02v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-02v</B></FONT></TD><TD PORT="Server-dc-03v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-03v</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-04v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-04v</B></FONT></TD><TD PORT="Server-dc-05v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-05v</B></FONT></TD><TD PORT="Server-dc-06v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-06v</B></FONT></TD></TR></TABLE></FONT></TD><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="192.168.5.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.5.0</B></FONT></TD><TD PORT="192.168.7.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.7.0</B></FONT></TD><TD PORT="192.168.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.9.0</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="172.16.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.9.0</B></FONT></TD><TD PORT="172.16.18.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.18.0</B></FONT></TD><TD PORT="10.10.8.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>10.10.8.0</B></FONT></TD></TR></TABLE></FONT></TD></TR><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Icon</B></FONT></TD></TR><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Test</B></FONT></TD></TR></TABLE>'
    }

    It "Should return a multiple column HMLT table with Label and Logo at top" {
        $HTMLSubgraphLogoTop | Should -BeExactly '<TABLE COLOR="#000000" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD valign="BOTTOM" ALIGN="Center" colspan="2" fixedsize="true" width="40" height="40"><IMG src="Diagrammer.png"></IMG></TD></TR><TR><TD valign="TOP" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Test</B></FONT></TD></TR><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-01v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-01v</B></FONT></TD><TD PORT="Server-dc-02v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-02v</B></FONT></TD><TD PORT="Server-dc-03v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-03v</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-04v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-04v</B></FONT></TD><TD PORT="Server-dc-05v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-05v</B></FONT></TD><TD PORT="Server-dc-06v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-06v</B></FONT></TD></TR></TABLE></FONT></TD><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="192.168.5.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.5.0</B></FONT></TD><TD PORT="192.168.7.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.7.0</B></FONT></TD><TD PORT="192.168.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.9.0</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="172.16.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.9.0</B></FONT></TD><TD PORT="172.16.18.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.18.0</B></FONT></TD><TD PORT="10.10.8.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>10.10.8.0</B></FONT></TD></TR></TABLE></FONT></TD></TR></TABLE>'
    }

    It "Should return a multiple column HMLT table with Label and Logo at top" {
        $HTMLSubgraphLogoTopDebug | Should -BeExactly '<TABLE COLOR="red" border="1" cellborder="1" cellpadding="5"><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Icon</B></FONT></TD></TR><TR><TD bgcolor="#FFCCCC" ALIGN="Center" colspan="2"><FONT FACE="Segoe Ui Black" Color="#565656" POINT-SIZE="18"><B>SubGraph Test</B></FONT></TD></TR><TR><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-01v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-01v</B></FONT></TD><TD PORT="Server-dc-02v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-02v</B></FONT></TD><TD PORT="Server-dc-03v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-03v</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_DC.png"/></TD></TR><TR><TD PORT="Server-dc-04v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-04v</B></FONT></TD><TD PORT="Server-dc-05v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-05v</B></FONT></TD><TD PORT="Server-dc-06v" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>Server-dc-06v</B></FONT></TD></TR></TABLE></FONT></TD><TD align="Center" colspan="1"><FONT POINT-SIZE="14"><TABLE COLOR="#000000" PORT="EdgeDot" border="0" cellborder="0" cellpadding="5" cellspacing="5"><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="192.168.5.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.5.0</B></FONT></TD><TD PORT="192.168.7.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.7.0</B></FONT></TD><TD PORT="192.168.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>192.168.9.0</B></FONT></TD></TR><TR><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD><TD ALIGN="Center" colspan="1"><img src="AD_Subnets.png"/></TD></TR><TR><TD PORT="172.16.9.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.9.0</B></FONT></TD><TD PORT="172.16.18.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>172.16.18.0</B></FONT></TD><TD PORT="10.10.8.0" ALIGN="Center" colspan="1"><FONT POINT-SIZE="14"><B>10.10.8.0</B></FONT></TD></TR></TABLE></FONT></TD></TR></TABLE>'
    }
}