Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (tests): Fix tests to be compatible with Pester v5 #29

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'

Describe "GoldSourceRcon" -Tag 'Unit' {

$gameservers = [ordered]@{
# Goldsource
cstrike = @{
Address = 'cs.startersclan.com'
Port = 27815
}
czero = @{
Address = 'cs.startersclan.com'
Port = 27615
}
valve = @{
Address = 'hl.startersclan.com'
Port = 27915
BeforeEach {
$gameservers = [ordered]@{
# Goldsource
cstrike = @{
Address = 'cs.startersclan.com'
Port = 27815
}
czero = @{
Address = 'cs.startersclan.com'
Port = 27615
}
valve = @{
Address = 'hl.startersclan.com'
Port = 27915
}
}
}

Expand Down
76 changes: 39 additions & 37 deletions src/PSSourceQuery/public/SourceQuery.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,45 @@ Describe "SourceQuery" -Tag 'Unit' {

Context 'Behavior' {

$gameservers = [ordered]@{
# Source
cs2 = @{
Address = 'cs.startersclan.com'
Port = 27125
Engine = 'Source'
}
csgo = @{
Address = 'cs.startersclan.com'
Port = 27115
Engine = 'Source'
}
left4dead2 = @{
Address = 'l4d.startersclan.com'
Port = 27015
Engine = 'Source'
}
hl2mp = @{
Address = 'hl.startersclan.com'
Port = 27215
Engine = 'Source'
}
# Goldsource
cstrike = @{
Address = 'cs.startersclan.com'
Port = 27815
Engine = 'Goldsource'
}
czero = @{
Address = 'cs.startersclan.com'
Port = 27615
Engine = 'Goldsource'
}
valve = @{
Address = 'hl.startersclan.com'
Port = 27915
Engine = 'Goldsource'
BeforeEach {
$gameservers = [ordered]@{
# Source
cs2 = @{
Address = 'cs.startersclan.com'
Port = 27125
Engine = 'Source'
}
csgo = @{
Address = 'cs.startersclan.com'
Port = 27115
Engine = 'Source'
}
left4dead2 = @{
Address = 'l4d.startersclan.com'
Port = 27015
Engine = 'Source'
}
hl2mp = @{
Address = 'hl.startersclan.com'
Port = 27215
Engine = 'Source'
}
# Goldsource
cstrike = @{
Address = 'cs.startersclan.com'
Port = 27815
Engine = 'Goldsource'
}
czero = @{
Address = 'cs.startersclan.com'
Port = 27615
Engine = 'Goldsource'
}
valve = @{
Address = 'hl.startersclan.com'
Port = 27915
Engine = 'Goldsource'
}
}
}

Expand Down
30 changes: 17 additions & 13 deletions src/PSSourceQuery/public/SourceRcon.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'

Describe "SourceRcon" -Tag 'Unit' {

$gameservers = [ordered]@{
# Source
# left4dead2 = @{
# Address = 'l4d.startersclan.com'
# Port = 27015
# }
csgo = @{
Address = 'cs.startersclan.com'
Port = 27115
}
hl2mp = @{
Address = 'hl.startersclan.com'
Port = 27215
BeforeEach {
$gameservers = [ordered]@{
# Source
# left4dead2 = @{
# Address = 'l4d.startersclan.com'
# Port = 27015
# }
csgo = @{
Address = 'cs.startersclan.com'
Port = 27115
}
hl2mp = @{
Address = 'hl.startersclan.com'
Port = 27215
}
}

. "$here/../private/Resolve-DNS.ps1"
}

Context 'Error handling' {
Expand Down
Loading