File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Import-Module PSScriptAnalyzer
2- $helperNamespace = ' Microsoft.Windows.PowerShell.ScriptAnalyzer' ;
3-
42
53Describe " Test Directed Graph" {
64 Context " When a graph is created" {
@@ -9,17 +7,21 @@ Describe "Test Directed Graph" {
97 $digraph.AddVertex (' v2' );
108 $digraph.AddVertex (' v3' );
119 $digraph.AddVertex (' v4' );
10+ $digraph.AddVertex (' v5' );
11+
1212 $digraph.AddEdge (' v1' , ' v2' );
13+ $digraph.AddEdge (' v1' , ' v5' );
1314 $digraph.AddEdge (' v2' , ' v4' );
1415
1516 It " correctly adds the vertices" {
16- $digraph.NumVertices | Should Be 4
17+ $digraph.NumVertices | Should Be 5
1718 }
1819
1920 It " correctly adds the edges" {
20- $digraph.GetNumNeighbors (' v1' ) | Should Be 1
21+ $digraph.GetNumNeighbors (' v1' ) | Should Be 2
2122 $neighbors = $digraph.GetNeighbors (' v1' )
22- $neighbors [0 ] | Should Be ' v2'
23+ $neighbors -contains ' v2' | Should Be $true
24+ $neighbors -contains ' v5' | Should Be $true
2325 }
2426
2527 It " finds the connection" {
You can’t perform that action at this time.
0 commit comments