Public/Get-PegasusEnvironment.tests.ps1

BeforeAll {
    $Script:Module = Import-Module -Name "$PSScriptRoot/../" -Force -PassThru
}

Describe "Get-PegasusEnvironment Tests" {
    It "Should return the correct environment information using named parameter" {
        $env = Get-PegasusEnvironment -Id "prod1"
        $env.Resource | Should -Be "c7c06297-19b3-4498-ba12-9258725b34a6"
        $env.FQDN | Should -Be "pegasusprod1restapi.azurewebsites.net"
    }

    It "Should return the correct environment information using positional parameter" {
        $env = Get-PegasusEnvironment "prod1"
        $env.Resource | Should -Be "c7c06297-19b3-4498-ba12-9258725b34a6"
        $env.FQDN | Should -Be "pegasusprod1restapi.azurewebsites.net"
    }

    It "Should throw an error for an unknown environment" {
        { Get-PegasusEnvironment -Id "unknown" } | Should -Throw
    }
}