mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
refactor(tests): streamline test cases
This commit is contained in:
@@ -34,6 +34,7 @@ Describe 'Disable-TelemetryScheduledTasks' {
|
||||
}
|
||||
Mock Invoke-NonBlocking { @{ Success = $true; Status = 'Disabled' } }
|
||||
Mock Write-Host {}
|
||||
Mock Write-Warning {}
|
||||
}
|
||||
|
||||
It 'dispatches every task to the non-blocking scheduler' {
|
||||
@@ -175,7 +176,6 @@ Describe 'Disable-TelemetryScheduledTasks' {
|
||||
It 'returns false for an unknown scheduler result' {
|
||||
Mock Get-TelemetryScheduledTasks { @(@{ Path = '\Microsoft\Windows\Test\'; Name = 'Telemetry' }) }
|
||||
Mock Invoke-NonBlocking { $null }
|
||||
Mock Write-Warning {}
|
||||
|
||||
Disable-TelemetryScheduledTasks | Should -BeFalse
|
||||
Should -Invoke Write-Warning -Times 1 -Exactly
|
||||
@@ -194,6 +194,7 @@ Describe 'Enable-TelemetryScheduledTasks' {
|
||||
}
|
||||
Mock Invoke-NonBlocking { @{ Success = $true; Status = 'Enabled' } }
|
||||
Mock Write-Host {}
|
||||
Mock Write-Warning {}
|
||||
}
|
||||
|
||||
It 'dispatches every task to the non-blocking scheduler' {
|
||||
@@ -305,7 +306,6 @@ Describe 'Enable-TelemetryScheduledTasks' {
|
||||
It 'returns false when the scheduler throws' {
|
||||
Mock Get-TelemetryScheduledTasks { @(@{ Path = '\Microsoft\Windows\Test\'; Name = 'Telemetry' }) }
|
||||
Mock Invoke-NonBlocking { throw 'scheduler unavailable' }
|
||||
Mock Write-Warning {}
|
||||
|
||||
Enable-TelemetryScheduledTasks | Should -BeFalse
|
||||
Should -Invoke Write-Warning -Times 1 -Exactly -ParameterFilter { $Message -match 'scheduler unavailable' }
|
||||
|
||||
Reference in New Issue
Block a user