@@ -8,16 +8,21 @@ Describe "SourceQuery" -Tag 'Unit' {
88
99 $gameservers = [ordered ]@ {
1010 # Source
11- # left4dead2 = @{
12- # Address = 'l4d .startersclan.com'
13- # Port = 27016
14- # Engine = 'Source'
15- # }
11+ cs2 = @ {
12+ Address = ' cs .startersclan.com'
13+ Port = 27125
14+ Engine = ' Source'
15+ }
1616 csgo = @ {
1717 Address = ' cs.startersclan.com'
1818 Port = 27115
1919 Engine = ' Source'
2020 }
21+ left4dead2 = @ {
22+ Address = ' l4d.startersclan.com'
23+ Port = 27015
24+ Engine = ' Source'
25+ }
2126 hl2mp = @ {
2227 Address = ' hl.startersclan.com'
2328 Port = 27215
@@ -47,11 +52,26 @@ Describe "SourceQuery" -Tag 'Unit' {
4752 . " $here \..\private\Resolve-DNS.ps1"
4853
4954 foreach ($game in $gameservers.Keys ) {
55+ " Testing $game " | Write-Host
5056 $params = $gameservers [$game ]
5157 $result = SourceQuery @params - Type $type
58+ $result [' Protocol' ] | Should - BeOfType [int ]
59+ $result [' Name' ] | Should - BeOfType [string ]
60+ $result [' Map' ] | Should - BeOfType [string ]
61+ $result [' Folder' ] | Should - BeOfType [string ]
62+ $result [' Game' ] | Should - BeOfType [string ]
63+ $result [' ID' ] | Should - BeOfType [int ]
64+ $result [' Players' ] | Should - BeOfType [int ]
65+ $result [' Max_players' ] | Should - BeOfType [int ]
66+ $result [' Bots' ] | Should - BeOfType [int ]
67+ $result [' Server_type' ] | Should - BeOfType [int ]
68+ $result [' Environment' ] | Should - BeOfType [string ]
69+ $result [' Visibility' ] | Should - BeOfType [string ]
70+ $result [' VAC' ] | Should - BeOfType [string ]
71+ $result [' Version' ] | Should - BeOfType [string ]
72+ $result [' Port' ] | Should - BeOfType [int ]
5273 $result | Should - BeOfType [System.Collections.Specialized.OrderedDictionary ]
5374 }
54-
5575 }
5676
5777 It ' Gets players' {
@@ -60,11 +80,13 @@ Describe "SourceQuery" -Tag 'Unit' {
6080 . " $here \..\private\Resolve-DNS.ps1"
6181
6282 foreach ($game in $gameservers.Keys ) {
83+ " Testing $game " | Write-Host
6384 $params = $gameservers [$game ]
6485 $result = SourceQuery @params - Type $type
86+ $result.Players_count | Should - BeOfType [int ]
87+ , $result.Players | Should - BeOfType [System.Collections.ArrayList ]
6588 $result | Should - BeOfType [System.Collections.Specialized.OrderedDictionary ]
6689 }
67-
6890 }
6991
7092 It ' Gets rules' {
@@ -73,18 +95,21 @@ Describe "SourceQuery" -Tag 'Unit' {
7395 . " $here \..\private\Resolve-DNS.ps1"
7496
7597 foreach ($game in $gameservers.Keys ) {
98+ " Testing $game " | Write-Host
7699 $params = $gameservers [$game ]
77100 $result = SourceQuery @params - Type $type
101+ $result.Rules_count | Should - BeOfType [int ]
102+ , $result.Rules | Should - BeOfType [System.Collections.ArrayList ]
78103 $result | Should - BeOfType [System.Collections.Specialized.OrderedDictionary ]
79104 }
80-
81105 }
82106
83107 # Deprecated
84108 # It 'Gets ping' {
85109 # $type = 'ping'
86110
87111 # foreach ($game in $gameservers.Keys) {
112+ # "Testing $game" | Write-Host
88113 # $params = $gameservers[$game]
89114 # Write-Host "game: $game"
90115 # $result = SourceQuery @params -Type $type
0 commit comments