Tests/Add-ARMvariable.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 "Add-ARMvariable" { New-ArmTemplate $expected = @{ Name = "Test" Value = "foo-bar" } $actual = New-ARMvariable @expected Context "Without pipeline" { Add-ARMvariable -InputObject $actual $template = Get-ARMTemplate It "Should add a variable to a template" { $template.variables | should not be $null } It "Should have a property named [$($expected.Name)]" { $template.variables.($expected.Name) | should not be $null } } Context "With pipeline" { New-ArmTemplate $actual | Add-ARMvariable $template = Get-ARMTemplate It "Should add a variable to a template" { $template.variables | should not be $null } It "Should have a property named [$($expected.Name)]" { $template.variables.($expected.Name) | should not be $null } } } Remove-Module -name posharm -ErrorAction SilentlyContinue |