Files
ZertoApiWrapper/Tests/Public/Connect-ZertoServer.Tests.ps1
T
2019-02-19 17:27:53 -05:00

26 lines
907 B
PowerShell

$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. ../$sut
. ../Invoke-ZertoRestRequest.ps1
. ../Disconnect-ZertoServer.ps1
$credential = Import-Clixml -Path C:\ZertoScripts\Creds.xml
$zertoServer = "192.168.222.20"
$zertoPort = "9669"
Describe "Connect-ZertoServer" {
it "should exist" {
"../Invoke-ZertoRestRequest.ps1" | should exist
}
it "has a function called Connect-ZertoServer" {
get-command Connect-ZertoServer | should be $true
}
Connect-ZertoServer -zertoServer $zertoServer -zertoPort $zertoPort -credential $credential
it "set an Env variable called zertoConnectionInformation" {
Test-Path Env:/zertoConnectionInformation | should be $true
}
it "set an Env variable called zertoAuthorizationHeaders" {
Test-Path Env:/zertoAuthorizationHeaders | should be $true
}
Disconnect-ZertoServer
}