File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
Import-Module PSScriptAnalyzer
2
- $helperNamespace = ' Microsoft.Windows.PowerShell.ScriptAnalyzer' ;
3
-
4
2
5
3
Describe " Test Directed Graph" {
6
4
Context " When a graph is created" {
@@ -9,17 +7,21 @@ Describe "Test Directed Graph" {
9
7
$digraph.AddVertex (' v2' );
10
8
$digraph.AddVertex (' v3' );
11
9
$digraph.AddVertex (' v4' );
10
+ $digraph.AddVertex (' v5' );
11
+
12
12
$digraph.AddEdge (' v1' , ' v2' );
13
+ $digraph.AddEdge (' v1' , ' v5' );
13
14
$digraph.AddEdge (' v2' , ' v4' );
14
15
15
16
It " correctly adds the vertices" {
16
- $digraph.NumVertices | Should Be 4
17
+ $digraph.NumVertices | Should Be 5
17
18
}
18
19
19
20
It " correctly adds the edges" {
20
- $digraph.GetNumNeighbors (' v1' ) | Should Be 1
21
+ $digraph.GetNumNeighbors (' v1' ) | Should Be 2
21
22
$neighbors = $digraph.GetNeighbors (' v1' )
22
- $neighbors [0 ] | Should Be ' v2'
23
+ $neighbors -contains ' v2' | Should Be $true
24
+ $neighbors -contains ' v5' | Should Be $true
23
25
}
24
26
25
27
It " finds the connection" {
You can’t perform that action at this time.
0 commit comments