diff --git a/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 b/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 index 6c2de2a..b444c39 100644 --- a/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 +++ b/src/PSSourceQuery/public/GoldSourceRcon.Tests.ps1 @@ -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 + } } } diff --git a/src/PSSourceQuery/public/SourceQuery.Tests.ps1 b/src/PSSourceQuery/public/SourceQuery.Tests.ps1 index 5ac09a8..6378b15 100644 --- a/src/PSSourceQuery/public/SourceQuery.Tests.ps1 +++ b/src/PSSourceQuery/public/SourceQuery.Tests.ps1 @@ -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' + } } } diff --git a/src/PSSourceQuery/public/SourceRcon.Tests.ps1 b/src/PSSourceQuery/public/SourceRcon.Tests.ps1 index cfa20bc..c0993ac 100644 --- a/src/PSSourceQuery/public/SourceRcon.Tests.ps1 +++ b/src/PSSourceQuery/public/SourceRcon.Tests.ps1 @@ -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' {