From 19afd20ccdf7176ca0bcaa866b7afb7e3e9d9047 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 29 Jul 2021 21:45:59 +0200 Subject: [PATCH] Tests: fix indent/align (with Visual Formatter Code) --- Tests/DCIM.Devices.Tests.ps1 | 12 ++++++------ Tests/DCIM.Interfaces.Tests.ps1 | 20 ++++++++++---------- Tests/DCIM.Platforms.Tests.ps1 | 10 +++++----- Tests/Helpers.Tests.ps1 | 24 ++++++++++++------------ Tests/IPAM.Tests.ps1 | 14 +++++++------- Tests/Virtualization.Tests.ps1 | 22 +++++++++++----------- 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Tests/DCIM.Devices.Tests.ps1 b/Tests/DCIM.Devices.Tests.ps1 index 5af9b8e..4b7bafa 100644 --- a/Tests/DCIM.Devices.Tests.ps1 +++ b/Tests/DCIM.Devices.Tests.ps1 @@ -28,12 +28,12 @@ Describe -Name "DCIM Devices Tests" -Tag 'DCIM', 'Devices' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -ModuleName 'NetboxPS' -MockWith { # Return a hashtable of the items we would normally pass to Invoke-RestMethod return [ordered]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body + 'Body' = $Body } } @@ -363,7 +363,7 @@ Describe -Name "DCIM Devices Tests" -Tag 'DCIM', 'Devices' -Fixture { Mock -CommandName "Get-NetboxDCIMDevice" -ModuleName NetboxPS -MockWith { return [pscustomobject]@{ - 'Id' = $Id + 'Id' = $Id 'Name' = $Name } } diff --git a/Tests/DCIM.Interfaces.Tests.ps1 b/Tests/DCIM.Interfaces.Tests.ps1 index 5499ce7..4ab521a 100644 --- a/Tests/DCIM.Interfaces.Tests.ps1 +++ b/Tests/DCIM.Interfaces.Tests.ps1 @@ -28,12 +28,12 @@ Describe -Name "DCIM Interfaces Tests" -Tag 'DCIM', 'Interfaces' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -ModuleName 'NetboxPS' -MockWith { # Return a hashtable of the items we would normally pass to Invoke-RestMethod return [ordered]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body + 'Body' = $Body } } @@ -139,13 +139,13 @@ Describe -Name "DCIM Interfaces Tests" -Tag 'DCIM', 'Interfaces' -Fixture { It "Should add an interface to a device with lots of properties" { $paramAddNetboxDCIMInterface = @{ - Device = 123 - Name = "TestInterface" + Device = 123 + Name = "TestInterface" Form_Factor = '10GBASE-T (10GE)' - MTU = 9000 - MGMT_Only = $true + MTU = 9000 + MGMT_Only = $true Description = 'Test Description' - Mode = 'Access' + Mode = 'Access' } $Result = Add-NetboxDCIMInterface @paramAddNetboxDCIMInterface diff --git a/Tests/DCIM.Platforms.Tests.ps1 b/Tests/DCIM.Platforms.Tests.ps1 index 7d2853a..c13aca6 100644 --- a/Tests/DCIM.Platforms.Tests.ps1 +++ b/Tests/DCIM.Platforms.Tests.ps1 @@ -28,12 +28,12 @@ Describe -Name "DCIM Platforms Tests" -Tag 'DCIM', 'platforms' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -ModuleName 'NetboxPS' -MockWith { # Return a hashtable of the items we would normally pass to Invoke-RestMethod return [ordered]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body + 'Body' = $Body } } diff --git a/Tests/Helpers.Tests.ps1 b/Tests/Helpers.Tests.ps1 index 594209d..059adcc 100644 --- a/Tests/Helpers.Tests.ps1 +++ b/Tests/Helpers.Tests.ps1 @@ -88,7 +88,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { Context -Name "Building URI components" -Fixture { It "Should give a basic hashtable" { - $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'param1' = 1} + $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'param1' = 1 } $URIComponents | Should -BeOfType [hashtable] $URIComponents.Keys.Count | Should -BeExactly 2 @@ -100,7 +100,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { } It "Should add a single ID parameter to the segments" { - $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'id' = 123} + $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'id' = 123 } $URIComponents | Should -BeOfType [hashtable] $URIComponents.Keys.Count | Should -BeExactly 2 @@ -111,7 +111,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { } It "Should add multiple IDs to the parameters id__in" { - $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'id' = "123", "456"} + $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'id' = "123", "456" } $URIComponents | Should -BeOfType [hashtable] $URIComponents.Keys.Count | Should -BeExactly 2 @@ -123,7 +123,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { } It "Should skip a particular parameter name" { - $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'param1' = 1; 'param2' = 2} -SkipParameterByName 'param2' + $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'param1' = 1; 'param2' = 2 } -SkipParameterByName 'param2' $URIComponents | Should -BeOfType [hashtable] $URIComponents.Keys.Count | Should -BeExactly 2 @@ -136,7 +136,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { } It "Should add a query (q) parameter" { - $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'query' = 'mytestquery'} + $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{'query' = 'mytestquery' } $URIComponents | Should -BeOfType [hashtable] $URIComponents.Keys.Count | Should -BeExactly 2 @@ -150,7 +150,7 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { It "Should generate custom field parameters" { $URIComponents = BuildURIComponents -URISegments @('segment1', 'segment2') -ParametersDictionary @{ 'CustomFields' = @{ - 'PRTG_Id' = 1234 + 'PRTG_Id' = 1234 'Customer_Id' = 'abc' } } @@ -170,13 +170,13 @@ Describe "Helpers tests" -Tag 'Core', 'Helpers' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -MockWith { # Return an object of the items we would normally pass to Invoke-RestMethod return [pscustomobject]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body - 'results' = 'Only results' + 'Body' = $Body + 'results' = 'Only results' } } diff --git a/Tests/IPAM.Tests.ps1 b/Tests/IPAM.Tests.ps1 index 6b214e9..6851ca0 100644 --- a/Tests/IPAM.Tests.ps1 +++ b/Tests/IPAM.Tests.ps1 @@ -29,12 +29,12 @@ Describe -Name "IPAM tests" -Tag 'Ipam' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -ModuleName 'NetboxPS' -MockWith { # Return a hashtable of the items we would normally pass to Invoke-RestMethod return [ordered]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body + 'Body' = $Body } } @@ -422,7 +422,7 @@ Describe -Name "IPAM tests" -Tag 'Ipam' -Fixture { Mock -CommandName "Get-NetboxIPAMAddress" -ModuleName NetboxPS -MockWith { return @{ 'address' = "10.1.1.1/$Id" - 'id' = $id + 'id' = $id } } @@ -486,7 +486,7 @@ Describe -Name "IPAM tests" -Tag 'Ipam' -Fixture { Mock -CommandName "Get-NetboxIPAMAddress" -ModuleName NetboxPS -MockWith { return @{ 'address' = '10.1.1.1/24' - 'id' = $id + 'id' = $id } } diff --git a/Tests/Virtualization.Tests.ps1 b/Tests/Virtualization.Tests.ps1 index 0eb2682..7b25f39 100644 --- a/Tests/Virtualization.Tests.ps1 +++ b/Tests/Virtualization.Tests.ps1 @@ -28,12 +28,12 @@ Describe -Name "Virtualization tests" -Tag 'Virtualization' -Fixture { Mock -CommandName 'Invoke-RestMethod' -Verifiable -ModuleName 'NetboxPS' -MockWith { # Return a hashtable of the items we would normally pass to Invoke-RestMethod return [ordered]@{ - 'Method' = $Method - 'Uri' = $Uri - 'Headers' = $Headers - 'Timeout' = $Timeout + 'Method' = $Method + 'Uri' = $Uri + 'Headers' = $Headers + 'Timeout' = $Timeout 'ContentType' = $ContentType - 'Body' = $Body + 'Body' = $Body } } @@ -365,7 +365,7 @@ Describe -Name "Virtualization tests" -Tag 'Virtualization' -Fixture { Mock -CommandName "Get-NetboxVirtualMachine" -ModuleName NetboxPS -MockWith { return [pscustomobject]@{ - 'Id' = $Id + 'Id' = $Id 'Name' = $Name } } @@ -406,7 +406,7 @@ Describe -Name "Virtualization tests" -Tag 'Virtualization' -Fixture { Mock -CommandName "Get-NetboxVirtualMachineInterface" -ModuleName NetboxPS -MockWith { return [pscustomobject]@{ - 'Id' = $Id + 'Id' = $Id 'Name' = $Name } } @@ -426,12 +426,12 @@ Describe -Name "Virtualization tests" -Tag 'Virtualization' -Fixture { It "Should set an interface to a new name, MTU, MAC address and description" { $paramSetNetboxVirtualMachineInterface = @{ - Id = 1234 - Name = 'newtestname' + Id = 1234 + Name = 'newtestname' MAC_Address = '11:22:33:44:55:66' - MTU = 9000 + MTU = 9000 Description = "Test description" - Force = $true + Force = $true } $Result = Set-NetboxVirtualMachineInterface @paramSetNetboxVirtualMachineInterface