diff --git a/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ReportCreation.Tests.ps1 b/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ReportCreation.Tests.ps1 index 630c88f3b4..22c1f7a6e4 100644 --- a/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ReportCreation.Tests.ps1 +++ b/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ReportCreation.Tests.ps1 @@ -1,9 +1,8 @@ $OrchestratorPath = '../../../../Modules/Orchestrator.psm1' $CreateReportPath = '../../../../Modules/CreateReport/CreateReport.psm1' -$UtilityPath = '../../../../Modules/Utility/Utility.psm1' Import-Module (Join-Path -Path $PSScriptRoot -ChildPath $OrchestratorPath) -Function Invoke-ReportCreation -Force Import-Module (Join-Path -Path $PSScriptRoot -ChildPath $CreateReportPath) -Function New-Report, Import-SecureBaseline -Force -Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath $UtilityPath) -Function Get-Utf8NoBom -Force + InModuleScope Orchestrator { Describe -Tag 'Orchestrator' -Name 'Invoke-ReportCreation' { BeforeAll { @@ -20,6 +19,7 @@ InModuleScope Orchestrator { Mock -CommandName Get-Content {} Mock -CommandName Add-Type {} Mock -CommandName Invoke-Item {} + function Get-Utf8NoBom {throw 'this will be mocked'} Mock -CommandName Get-Utf8NoBom {} Mock -CommandName ConvertFrom-Json { @{ "report_uuid"="" } } } diff --git a/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ScubaCached.Tests.ps1 b/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ScubaCached.Tests.ps1 index cdb6d2dcdb..1dfdb395ab 100644 --- a/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ScubaCached.Tests.ps1 +++ b/PowerShell/ScubaGear/Testing/Unit/PowerShell/Orchestrator/Invoke-ScubaCached.Tests.ps1 @@ -119,15 +119,15 @@ InModuleScope Orchestrator { {Invoke-SCuBACached @SplatParams} | Should -Not -Throw } It 'Given an existing UUID should not generate a new one' { - # Get-Member was mocked above to return True so the as far as the + # Get-Member was mocked above to return True so as far as the # provider can tell, the existing output already has a UUID {Invoke-SCuBACached @SplatParams} | Should -Not -Throw Should -Invoke -CommandName New-Guid -Exactly -Times 0 } It 'Given output without a UUID should generate a new one' { Mock -CommandName Get-Member { $false } - # Now Get-Member will return False so the as far as the - # provider can tell, the existing output does not have a UUID + # Now Get-Member will return False so as far as the provider + # can tell, the existing output does not have a UUID {Invoke-SCuBACached @SplatParams} | Should -Not -Throw Should -Invoke -CommandName New-Guid -Exactly -Times 1 }