From 1a5e2dd0b71d9d600cc5ef07693696cf076fd509 Mon Sep 17 00:00:00 2001 From: Celerium Date: Sun, 29 Oct 2023 17:14:51 -0600 Subject: [PATCH] Fixed placeholder pester tests --- ...s.ps1 => Get-MyITProcessClients.Tests.ps1} | 0 ....ps1 => Get-MyITProcessFindings.Tests.ps1} | 0 .../Public/Get-MyITProcessIncidents.Tests.ps1 | 133 ------------------ ...1 => Get-MyITProcessInitiatives.Tests.ps1} | 0 ....ps1 => Get-MyITProcessMeetings.Tests.ps1} | 0 ... Get-MyITProcessRecommendations.Tests.ps1} | 0 ...s.ps1 => Get-MyITProcessReviews.Tests.ps1} | 0 ...sts.ps1 => Get-MyITProcessUsers.Tests.ps1} | 0 8 files changed, 133 deletions(-) rename tests/Public/{Get-MyITProcessAccounts.Tests.ps1 => Get-MyITProcessClients.Tests.ps1} (100%) rename tests/Public/{Get-MyITProcessAgents.Tests.ps1 => Get-MyITProcessFindings.Tests.ps1} (100%) delete mode 100644 tests/Public/Get-MyITProcessIncidents.Tests.ps1 rename tests/Public/{Get-MyITProcessApps.Tests.ps1 => Get-MyITProcessInitiatives.Tests.ps1} (100%) rename tests/Public/{Get-MyITProcessDefender.Tests.ps1 => Get-MyITProcessMeetings.Tests.ps1} (100%) rename tests/Public/{Get-MyITProcessEvents.Tests.ps1 => Get-MyITProcessRecommendations.Tests.ps1} (100%) rename tests/Public/{Get-MyITProcessFirewalls.Tests.ps1 => Get-MyITProcessReviews.Tests.ps1} (100%) rename tests/Public/{Get-MyITProcessOffice.Tests.ps1 => Get-MyITProcessUsers.Tests.ps1} (100%) diff --git a/tests/Public/Get-MyITProcessAccounts.Tests.ps1 b/tests/Public/Get-MyITProcessClients.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessAccounts.Tests.ps1 rename to tests/Public/Get-MyITProcessClients.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessAgents.Tests.ps1 b/tests/Public/Get-MyITProcessFindings.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessAgents.Tests.ps1 rename to tests/Public/Get-MyITProcessFindings.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessIncidents.Tests.ps1 b/tests/Public/Get-MyITProcessIncidents.Tests.ps1 deleted file mode 100644 index 9111314..0000000 --- a/tests/Public/Get-MyITProcessIncidents.Tests.ps1 +++ /dev/null @@ -1,133 +0,0 @@ -<# - .SYNOPSIS - Pester tests for the MyITProcessAPI PLACEHOLDER functions - - .DESCRIPTION - Pester tests for the MyITProcessAPI PLACEHOLDER functions - - .PARAMETER moduleName - The name of the local module to import - - .PARAMETER Version - The version of the local module to import - - .PARAMETER buildTarget - Which version of the module to run tests against - - Allowed values: - 'built', 'notBuilt' - - .EXAMPLE - Invoke-Pester -Path .\Tests\Private\PLACEHOLDER\Get-MyITProcessPlaceholder.Tests.ps1 - - Runs a pester test and outputs simple results - - .EXAMPLE - Invoke-Pester -Path .\Tests\Private\PLACEHOLDER\Get-MyITProcessPlaceholder.Tests.ps1 -Output Detailed - - Runs a pester test and outputs detailed results - - .INPUTS - N\A - - .OUTPUTS - N\A - - .NOTES - N\A - - .LINK - https://celerium.org - -#> - -<############################################################################################ - Code -############################################################################################> -#Requires -Version 5.1 -#Requires -Modules @{ ModuleName='Pester'; ModuleVersion='5.5.0' } - -#Region [ Parameters ] - -#Available in Discovery & Run -[CmdletBinding()] -param ( - [Parameter( Mandatory = $false) ] - [ValidateNotNullOrEmpty()] - [String]$moduleName = 'MyITProcessAPI', - - [Parameter(Mandatory=$true)] - [ValidateNotNullOrEmpty()] - [String]$version, - - [Parameter(Mandatory=$true)] - [ValidateSet('built','notBuilt')] - [string]$buildTarget -) - -#EndRegion [ Parameters ] - -#Region [ Prerequisites ] - -#Available inside It but NOT Describe or Context - BeforeAll { - - if ($IsWindows -or $PSEdition -eq 'Desktop') { - $rootPath = "$( $PSCommandPath.Substring(0, $PSCommandPath.IndexOf('\tests', [System.StringComparison]::OrdinalIgnoreCase)) )" - } - else{ - $rootPath = "$( $PSCommandPath.Substring(0, $PSCommandPath.IndexOf('/tests', [System.StringComparison]::OrdinalIgnoreCase)) )" - } - - switch ($buildTarget){ - 'built' { $modulePath = Join-Path -Path $rootPath -ChildPath "\build\$moduleName\$version" } - 'notBuilt' { $modulePath = Join-Path -Path $rootPath -ChildPath "$moduleName" } - } - - if (Get-Module -Name $moduleName){ - Remove-Module -Name $moduleName -Force - } - - $modulePsd1 = Join-Path -Path $modulePath -ChildPath "$moduleName.psd1" - - Import-Module -Name $modulePsd1 -ErrorAction Stop -ErrorVariable moduleError *> $null - - if ($moduleError){ - $moduleError - exit 1 - } - - } - - AfterAll{ - - Remove-MyITProcessAPIKey -WarningAction SilentlyContinue - - if (Get-Module -Name $moduleName){ - Remove-Module -Name $moduleName -Force - } - - } - -#Available in Describe and Context but NOT It -#Can be used in [ It ] with [ -TestCases @{ VariableName = $VariableName } ] - BeforeDiscovery{ - - $pester_TestName = (Get-Item -Path $PSCommandPath).Name - $commandName = $pester_TestName -replace '.Tests.ps1','' - - } - -#EndRegion [ Prerequisites ] - -Describe "Testing [ $commandName ] function with [ $pester_TestName ]" -Tag @('PLACEHOLDER','apiCalls') { - - Context "[ $commandName ] testing function" { - - It "PLACEHOLDER" { - $false | Should -BeTrue - } - - } - -} \ No newline at end of file diff --git a/tests/Public/Get-MyITProcessApps.Tests.ps1 b/tests/Public/Get-MyITProcessInitiatives.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessApps.Tests.ps1 rename to tests/Public/Get-MyITProcessInitiatives.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessDefender.Tests.ps1 b/tests/Public/Get-MyITProcessMeetings.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessDefender.Tests.ps1 rename to tests/Public/Get-MyITProcessMeetings.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessEvents.Tests.ps1 b/tests/Public/Get-MyITProcessRecommendations.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessEvents.Tests.ps1 rename to tests/Public/Get-MyITProcessRecommendations.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessFirewalls.Tests.ps1 b/tests/Public/Get-MyITProcessReviews.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessFirewalls.Tests.ps1 rename to tests/Public/Get-MyITProcessReviews.Tests.ps1 diff --git a/tests/Public/Get-MyITProcessOffice.Tests.ps1 b/tests/Public/Get-MyITProcessUsers.Tests.ps1 similarity index 100% rename from tests/Public/Get-MyITProcessOffice.Tests.ps1 rename to tests/Public/Get-MyITProcessUsers.Tests.ps1