Tests/New-ARMTemplate.Tests.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#$here = Split-Path -Parent $MyInvocation.MyCommand.Path #$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' #. "$here\$sut" $modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath poshARM.psd1 Import-Module $modulePath Describe "New-ARMTemplate" { Context "Create Object" { $new = New-ArmTemplate It "Should return nothing if Passthru is not specified" { $new | Should Be $null } It "Should save the template in the Script:Template variable" { Get-ARMTemplate | should not be $null } It "Should have a [contentVersion] proptery" { (Get-ARMTemplate).contentVersion | Should be '1.0.0.0' } It "Should have a [parameters] property of type [PScustomobject]" { (Get-ARMTemplate).parameters.GetType().Name | Should be 'PScustomobject' } It "Should have a [variables] property of type [PScustomobject]" { (Get-ARMTemplate).variables.GetType().Name | Should be 'PScustomobject' } It "Should have a [resources] property of type Object[]" { (Get-ARMTemplate).resources.GetType().Name | Should be 'Object[]' } It "Should have a [outputs] property of type [PScustomobject]" { (Get-ARMTemplate).outputs.GetType().Name | Should be 'PScustomobject' } It "Should return an object if Passthru is specified" { $new = New-ArmTemplate -Passthru $new | Should not Be $null } } } Remove-Module -name posharm -ErrorAction SilentlyContinue |