forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndexer.Tests.ps1
More file actions
25 lines (18 loc) · 872 Bytes
/
Copy pathIndexer.Tests.ps1
File metadata and controls
25 lines (18 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Describe 'Tests for indexers' -Tags "CI" {
It 'Indexer in dictionary' {
$hashtable = @{ "Hello"="There" }
$hashtable["Hello"] | Should Be "There"
}
It 'Accessing a Indexed property of a dictionary that does not exist should return $NULL' {
$hashtable = @{ "Hello"="There" }
$hashtable["Hello There"] | Should Be $null
}
It 'Wmi object implements an indexer' -Skip:$IsCoreCLR {
$service = Get-WmiObject -List -Amended Win32_Service
$service.Properties["DisplayName"].Name | Should Be 'DisplayName'
}
It 'Accessing a Indexed property of a wmi object that does not exist should return $NULL' -skip:$IsCoreCLR {
$service = Get-WmiObject -List -Amended Win32_Service
$service.Properties["Hello There"] | Should Be $null
}
}