Skip to content

Commit

Permalink
adds pester test for .Parent
Browse files Browse the repository at this point in the history
santisq committed Sep 3, 2024
1 parent 170a8ed commit 6324c89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/PSTreeDirectory.tests.ps1
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@ Describe 'PSTreeDirectory' {
Should -BeIn ([System.IO.FileInfo], [System.IO.DirectoryInfo])
}

It '.Parent property gets the PSTreeDirectory Parent DirectoryInfo instance' {
(Get-PSTree $testPath -Depth 0).Parent | Should -BeOfType ([System.IO.DirectoryInfo])
}

It 'ItemCount gets the count of direct childs' {
$childCount = @(Get-ChildItem -Force $testPath).Count
(Get-PSTree $testPath -Depth 1 -Force)[0].ItemCount | Should -BeExactly $childCount

0 comments on commit 6324c89

Please sign in to comment.