tests/DiskHealth.Tests.ps1
|
$moduleRoot = Split-Path -Parent $PSScriptRoot Import-Module (Join-Path $moduleRoot 'Octa.psd1') -Force Describe 'Show-OctaDiskHealth' { It 'never changes registry or service state (SC-014-style non-mutation guarantee)' { $before = Get-Service | Select-Object -ExpandProperty Status { Show-OctaDiskHealth | Out-Null } | Should Not Throw $after = Get-Service | Select-Object -ExpandProperty Status (Compare-Object $before $after) | Should Be $null } It 'reports a real entry per physical disk with "not available" (not fabricated) for any missing counter' { $result = @(Show-OctaDiskHealth) $result.Count | Should BeGreaterThan 0 foreach ($r in $result) { $r.FriendlyName | Should Not BeNullOrEmpty # Each of these is either a real measured value or the literal honesty sentinel - # never $null/blank (research.md: confirmed a real per-field gap on real hardware). $r.TemperatureC | Should Not BeNullOrEmpty $r.PowerOnHours | Should Not BeNullOrEmpty $r.Wear | Should Not BeNullOrEmpty } } } |