mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
21 lines
796 B
PowerShell
21 lines
796 B
PowerShell
Describe "ProviderIntrinsics Tests" -tags "CI" {
|
|||
|
|
BeforeAll {
|
||
|
|
setup -d TestDir
|
||
|
|
}
|
||
|
|
It 'If a childitem exists, HasChild method returns $true' {
|
||
|
|
$ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE") | Should be $true
|
||
|
|
}
|
||
|
|
It 'If a childitem does not exist, HasChild method returns $false' {
|
||
|
|
$ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE/TestDir") | Should be $false
|
||
|
|
}
|
||
|
|
It 'If the path does not exist, HasChild throws an exception' {
|
||
|
|
try {
|
||
|
|
$ExecutionContext.InvokeProvider.ChildItem.HasChild("TESTDRIVE/ThisDirectoryDoesNotExist")
|
||
|
|
throw "Execution OK"
|
||
|
|
}
|
||
|
|
catch {
|
||
|
|
$_.fullyqualifiederrorid | should be "ItemNotFoundException"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|