-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathGet-AvailabilityInformation.Tests.ps1
More file actions
67 lines (55 loc) · 2.18 KB
/
Get-AvailabilityInformation.Tests.ps1
File metadata and controls
67 lines (55 loc) · 2.18 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
BeforeAll {
$scriptPath = "$PSScriptRoot\Get-AvailabilityInformation.ps1"
$script:scriptContent = Get-Content $scriptPath -Raw
}
Describe "Get-AvailabilityInformation.ps1 Tests" {
Context "Function Definitions" {
It "Should define Out-JSONFile function" {
$scriptContent | Should -Match 'function Out-JSONFile'
}
It "Should define Convert-LocationsToRegionCodes function" {
$scriptContent | Should -Match 'Function Convert-LocationsToRegionCode'
}
It "Should define Import-Provider function" {
$scriptContent | Should -Match 'Function Import-Provider'
}
It "Should define Import-Region function" {
$scriptContent | Should -Match 'function Import-Region'
}
It "Should define Get-Property function" {
$scriptContent | Should -Match 'Function Get-Property'
}
It "Should define Expand-NestedCollection function" {
$scriptContent | Should -Match 'Function Expand-NestedCollection'
}
}
Context "Logic Validation" {
It "Should have region map creation logic" {
$scriptContent | Should -Match 'RegionMap'
}
It "Should have SKU availability checking logic" {
$scriptContent | Should -Match 'available'
}
}
Context "File Dependencies" {
It "Should check for summary.json from 1-Collect" {
$summaryPath = "$(Get-Location)\..\1-Collect\summary.json"
# Test would validate the file check logic
$summaryPath | Should -Not -BeNullOrEmpty
}
It "Should check for propertyMaps.json" {
$propertyMapPath = ".\propertymaps\propertyMaps.json"
$propertyMapPath | Should -Not -BeNullOrEmpty
}
}
Context "Output Files" {
It "Should generate Availability_Mapping.json" {
$outputFile = "Availability_Mapping.json"
$outputFile | Should -Be "Availability_Mapping.json"
}
It "Should generate Azure_Providers.json" {
$outputFile = "Azure_Providers.json"
$outputFile | Should -Be "Azure_Providers.json"
}
}
}