From 1e64d9d7f397828c922b7ababc3d1e3f2e8cc966 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 12:57:21 -0400 Subject: [PATCH] Renamed Function --- .../{New-Map.Tests.ps1 => Get-Map.Tests.ps1} | 20 +++++++++---------- .../Private/{New-Map.ps1 => Get-Map.ps1} | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) rename Tests/Private/{New-Map.Tests.ps1 => Get-Map.Tests.ps1} (79%) rename ZertoApiWrapper/Private/{New-Map.ps1 => Get-Map.ps1} (96%) diff --git a/Tests/Private/New-Map.Tests.ps1 b/Tests/Private/Get-Map.Tests.ps1 similarity index 79% rename from Tests/Private/New-Map.Tests.ps1 rename to Tests/Private/Get-Map.Tests.ps1 index 6134a02..8aeca06 100644 --- a/Tests/Private/New-Map.Tests.ps1 +++ b/Tests/Private/Get-Map.Tests.ps1 @@ -12,9 +12,9 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { it "Input Object should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{ } - { New-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw - { New-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw - { New-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw } it "have a mandatory string parameter for the Map Key" { @@ -23,16 +23,16 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { it "The Map variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } - { New-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw - { New-Map -InputObject $null -Key $null -Value "Value" } | Should Throw - { New-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw + { Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw } it "The Value variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } - { New-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw - { New-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw - { New-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw } it "have a mandatory string parameter for the Map Value" { @@ -47,7 +47,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Function Tests" { $myObj = Get-Content "$global:here/Mocks/ProtectedVMs.json" | ConvertFrom-Json BeforeEach { - $MyMap = New-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" + $MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" } it "Returned object should be a hashtable" { $myMap | Should -BeOfType Hashtable diff --git a/ZertoApiWrapper/Private/New-Map.ps1 b/ZertoApiWrapper/Private/Get-Map.ps1 similarity index 96% rename from ZertoApiWrapper/Private/New-Map.ps1 rename to ZertoApiWrapper/Private/Get-Map.ps1 index b84ea9d..343a711 100644 --- a/ZertoApiWrapper/Private/New-Map.ps1 +++ b/ZertoApiWrapper/Private/Get-Map.ps1 @@ -1,4 +1,4 @@ -function New-Map { +function Get-Map { [CmdletBinding()] [OutputType([Hashtable])] param(