mirror of
https://github.com/NexusOne23/noid-privacy.git
synced 2026-02-07 12:11:53 +01:00
74 lines
2.9 KiB
PowerShell
74 lines
2.9 KiB
PowerShell
Describe "AdvancedSecurity Integration Tests" {
|
|
BeforeAll {
|
|
$script:ModulePath = Join-Path $PSScriptRoot "..\..\Modules\AdvancedSecurity"
|
|
$script:ManifestPath = Join-Path $script:ModulePath "AdvancedSecurity.psd1"
|
|
}
|
|
|
|
Context "Module Structure" {
|
|
It "Should have module manifest" {
|
|
Test-Path $script:ManifestPath | Should -Be $true
|
|
}
|
|
|
|
It "Should load module without errors" {
|
|
{ Import-Module $script:ManifestPath -Force -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should export Invoke-AdvancedSecurity function" {
|
|
$module = Get-Module AdvancedSecurity
|
|
$module.ExportedFunctions.Keys | Should -Contain "Invoke-AdvancedSecurity"
|
|
}
|
|
|
|
It "Should export Test-AdvancedSecurity function" {
|
|
$module = Get-Module AdvancedSecurity
|
|
$module.ExportedFunctions.Keys | Should -Contain "Test-AdvancedSecurity"
|
|
}
|
|
}
|
|
|
|
Context "Configuration Files" {
|
|
It "Should have SRP-Rules.json" {
|
|
$configPath = Join-Path $script:ModulePath "Config\SRP-Rules.json"
|
|
Test-Path $configPath | Should -Be $true
|
|
}
|
|
|
|
It "SRP-Rules.json should be valid" {
|
|
$configPath = Join-Path $script:ModulePath "Config\SRP-Rules.json"
|
|
{ Get-Content $configPath -Raw | ConvertFrom-Json -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should have WindowsUpdate.json" {
|
|
$configPath = Join-Path $script:ModulePath "Config\WindowsUpdate.json"
|
|
Test-Path $configPath | Should -Be $true
|
|
}
|
|
|
|
It "WindowsUpdate.json should be valid" {
|
|
$configPath = Join-Path $script:ModulePath "Config\WindowsUpdate.json"
|
|
{ Get-Content $configPath -Raw | ConvertFrom-Json -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
}
|
|
|
|
Context "DryRun Execution" {
|
|
It "Should run Invoke-AdvancedSecurity in DryRun mode without errors" {
|
|
{ Invoke-AdvancedSecurity -DryRun -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should run with Balanced profile in DryRun mode" {
|
|
{ Invoke-AdvancedSecurity -SecurityProfile "Balanced" -DryRun -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should run with Enterprise profile in DryRun mode" {
|
|
{ Invoke-AdvancedSecurity -SecurityProfile "Enterprise" -DryRun -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should run with Maximum profile in DryRun mode" {
|
|
{ Invoke-AdvancedSecurity -SecurityProfile "Maximum" -DryRun -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should run Test-AdvancedSecurity without errors" {
|
|
{ Test-AdvancedSecurity -ErrorAction Stop } | Should -Not -Throw
|
|
}
|
|
}
|
|
|
|
AfterAll {
|
|
Remove-Module AdvancedSecurity -ErrorAction SilentlyContinue
|
|
}
|
|
}
|