From 3d0a37b3b6bd6a2e22f9509e140d6efa88b1ddbe Mon Sep 17 00:00:00 2001 From: deadlydog Date: Sat, 20 Apr 2024 17:27:15 -0600 Subject: [PATCH] Add temp tests for troubleshooting --- src/tiPS/Public/Get-PowerShellTip.Tests.ps1 | 31 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/tiPS/Public/Get-PowerShellTip.Tests.ps1 b/src/tiPS/Public/Get-PowerShellTip.Tests.ps1 index b775746..2933322 100644 --- a/src/tiPS/Public/Get-PowerShellTip.Tests.ps1 +++ b/src/tiPS/Public/Get-PowerShellTip.Tests.ps1 @@ -176,11 +176,11 @@ InModuleScope -ModuleName tiPS { # Must use InModuleScope to access script-level $tip | Should -Not -BeNullOrEmpty $script:UnshownTips.Count | Should -Be ($TotalNumberOfTips - 1) + } - - - + + It 'temp troubleshooting 1' { # Temp code for troubleshooting tests on Windows PowerShell. [string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json" $content = Get-Content -Path $powerShellTipsJsonFilePath @@ -193,6 +193,31 @@ InModuleScope -ModuleName tiPS { # Must use InModuleScope to access script-level $content | Should -Be "not actually this" $numberOfTipsInJsonFile | Should -Be 48 } + + It 'temp troubleshooting 2' { + # Temp code for troubleshooting tests on Windows PowerShell. + [string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json" + $content = Get-Content -Path $powerShellTipsJsonFilePath + [int] $numberOfTipsInJsonFile = + $content | + ConvertFrom-Json | + Measure-Object | + Select-Object -ExpandProperty Count + $content | Should -Be "not actually this" + $numberOfTipsInJsonFile | Should -Be 48 + } + + It 'temp troubleshooting 3' { + # Temp code for troubleshooting tests on Windows PowerShell. + [string] $powerShellTipsJsonFilePath = Resolve-Path "$PSScriptRoot\..\PowerShellTips.json" + $content = Get-Content -Path $powerShellTipsJsonFilePath + [int] $numberOfTipsInJsonFile = + $content | + ConvertFrom-Json | + Measure-Object | + Select-Object -ExpandProperty Count + $numberOfTipsInJsonFile | Should -Be 48 + } } Context 'When only one tip is still left to be shown' {