-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Remove-JCRadiusServer.Tests.ps1
- Loading branch information
1 parent
67d5613
commit d280ebc
Showing
1 changed file
with
11 additions
and
7 deletions.
There are no files selected for viewing
18 changes: 11 additions & 7 deletions
18
PowerShell/JumpCloud Module/Tests/Public/RadiusServer/Remove-JCRadiusServer.Tests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
Describe -Tag:('JCRadiusServer') 'Remove-JCRadiusServer Tests' { | ||
BeforeAll { | ||
$PesterParams_RadiusServer = Get-JCRadiusServer -Name:($PesterParams_RadiusServer.name) | ||
If (-not $PesterParams_RadiusServer) { | ||
$PesterParams_RadiusServer = New-JCRadiusServer @PesterParams_NewRadiusServer | ||
} | ||
$NewRadiusServer = @{ | ||
networkSourceIp = [IPAddress]::Parse([String](Get-Random)).IPAddressToString | ||
sharedSecret = "$(Get-Random)" | ||
name = "PesterTest_RadiusServer_$(Get-Random)" | ||
authIdp = 'JUMPCLOUD' | ||
|
||
}; | ||
$RadiusServerTemplate = Create-RadiusServerTryCatch $NewRadiusServer | ||
} | ||
Context 'Remove-JCRadiusServer' { | ||
It ('Should remove a specific radius server.') { | ||
$RadiusServer = Remove-JCRadiusServer -Id:($PesterParams_RadiusServer.id) -Force; | ||
$RadiusServer = Remove-JCRadiusServer -Id:($RadiusServerTemplate.id) -Force; | ||
$RadiusServer | Should -Not -BeNullOrEmpty | ||
$RadiusServer.name | Should -Be $PesterParams_RadiusServer.name | ||
$RadiusServer.name | Should -Be $RadiusServerTemplate.name | ||
} | ||
} | ||
} | ||
} |