@@ -12,22 +12,27 @@ Import-Module $PathToManifest -Force
12
12
# -------------------------------------------------------------------------
13
13
14
14
InModuleScope ' ALZ' {
15
- Describe ' Request-ConfigurationValue Public Function Tests' - Tag Unit {
15
+ Describe ' Test-ALZRequirement Public Function Tests' - Tag Unit {
16
16
BeforeAll {
17
17
$WarningPreference = ' SilentlyContinue'
18
18
$ErrorActionPreference = ' SilentlyContinue'
19
19
}
20
- Context ' Non Az Module ' {
20
+ Context ' Incompatible Az module version lower than 10.0.0 ' {
21
21
BeforeEach {
22
- Mock - CommandName Get-Module - MockWith {
23
- $null
22
+ Mock - CommandName Get-AZVersion - MockWith {
23
+ [PSCustomObject ]@ {
24
+ Version = [PSCustomObject ]@ {
25
+ Major = 9
26
+ Minor = 7
27
+ }
28
+ }
24
29
}
25
30
}
26
- It ' should return the not met for non AZ module' {
31
+ It ' should return the not met for non compatible az module versions ' {
27
32
Test-ALZRequirement | Should - BeExactly " ALZ requirements are not met."
28
33
}
29
34
}
30
- Context ' Incompatible Powershell version lower them 7' {
35
+ Context ' Incompatible Powershell version lower than 7' {
31
36
BeforeEach {
32
37
Mock - CommandName Get-PSVersion - MockWith {
33
38
[PSCustomObject ]@ {
@@ -63,7 +68,7 @@ InModuleScope 'ALZ' {
63
68
$null
64
69
}
65
70
}
66
- It ' should return the not met for no git instalation ' {
71
+ It ' should return the not met for no git installation ' {
67
72
Test-ALZRequirement | Should - BeExactly " ALZ requirements are not met."
68
73
}
69
74
}
@@ -73,7 +78,7 @@ InModuleScope 'ALZ' {
73
78
$null
74
79
}
75
80
}
76
- It ' should return the not met for no Visual Studio Code instalation ' {
81
+ It ' should return the not met for no Visual Studio Code installation ' {
77
82
Test-ALZRequirement | Should - BeExactly " ALZ requirements are not met."
78
83
}
79
84
}
@@ -83,16 +88,18 @@ InModuleScope 'ALZ' {
83
88
$null
84
89
}
85
90
}
86
- It ' should return the not met for no bicep instalation ' {
91
+ It ' should return the not met for no bicep installation ' {
87
92
Test-ALZRequirement | Should - BeExactly " ALZ requirements are not met."
88
93
}
89
94
}
90
95
Context ' Success' {
91
-
92
96
BeforeEach {
93
- Mock - CommandName Get-Module - MockWith {
97
+ Mock - CommandName Get-AZVersion - MockWith {
94
98
[PSCustomObject ]@ {
95
- Name = ' Az'
99
+ Version = [PSCustomObject ]@ {
100
+ Major = 10
101
+ Minor = 0
102
+ }
96
103
}
97
104
}
98
105
Mock - CommandName Get-PSVersion - MockWith {
@@ -123,7 +130,6 @@ InModuleScope 'ALZ' {
123
130
It ' should return the expected results' {
124
131
Test-ALZRequirement | Should - BeExactly " ALZ requirements are met."
125
132
}
126
-
127
133
}
128
134
}
129
135
}
0 commit comments