Skip to content

Commit be5f31b

Browse files
committed
Made unit and integration tests verbose
1 parent 108a010 commit be5f31b

2 files changed

Lines changed: 43 additions & 40 deletions

File tree

Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ try
4040

4141
It "should apply the MOF correctly" {
4242
{
43-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
43+
Start-DscConfiguration -Path $ConfigDir -Verbose -Wait -Force
4444
} | Should Not Throw
4545
}
4646

4747
It "should return a compliant state after being applied" {
48-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
48+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
4949
}
5050
}
5151

@@ -62,12 +62,12 @@ try
6262

6363
It "should apply the MOF correctly" {
6464
{
65-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
65+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
6666
} | Should Not Throw
6767
}
6868

6969
It "should return a compliant state after being applied" {
70-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
70+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
7171
}
7272
}
7373

@@ -84,12 +84,12 @@ try
8484

8585
It "should apply the MOF correctly" {
8686
{
87-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
87+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
8888
} | Should Not Throw
8989
}
9090

9191
It "should return a compliant state after being applied" {
92-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
92+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
9393
}
9494
}
9595
#endregion
@@ -108,12 +108,12 @@ try
108108

109109
It "should apply the MOF correctly" {
110110
{
111-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
111+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
112112
} | Should Not Throw
113113
}
114114

115115
It "should return a compliant state after being applied" {
116-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
116+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
117117
}
118118
}
119119

@@ -130,12 +130,12 @@ try
130130

131131
It "should apply the MOF correctly" {
132132
{
133-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
133+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
134134
} | Should Not Throw
135135
}
136136

137137
It "should return a compliant state after being applied" {
138-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
138+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
139139
}
140140
}
141141

@@ -152,12 +152,12 @@ try
152152

153153
It "should apply the MOF correctly" {
154154
{
155-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
155+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
156156
} | Should Not Throw
157157
}
158158

159159
It "should return a compliant state after being applied" {
160-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
160+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
161161
}
162162
}
163163
#endregion
@@ -176,12 +176,12 @@ try
176176

177177
It "should apply the MOF correctly" {
178178
{
179-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
179+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
180180
} | Should Not Throw
181181
}
182182

183183
It "should return a compliant state after being applied" {
184-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
184+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
185185
}
186186
}
187187

@@ -198,12 +198,12 @@ try
198198

199199
It "should apply the MOF correctly" {
200200
{
201-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
201+
Start-DscConfiguration -Path $ConfigDir -Wait -Force -Verbose
202202
} | Should Not Throw
203203
}
204204

205205
It "should return a compliant state after being applied" {
206-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
206+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
207207
}
208208
}
209209

@@ -220,12 +220,12 @@ try
220220

221221
It "should apply the MOF correctly" {
222222
{
223-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
223+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
224224
} | Should Not Throw
225225
}
226226

227227
It "should return a compliant state after being applied" {
228-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
228+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
229229
}
230230
}
231231
#endregion
@@ -244,12 +244,12 @@ try
244244

245245
It "should apply the MOF correctly" {
246246
{
247-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
247+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
248248
} | Should Not Throw
249249
}
250250

251251
It "should return a compliant state after being applied" {
252-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
252+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
253253
}
254254
}
255255

@@ -266,12 +266,12 @@ try
266266

267267
It "should apply the MOF correctly" {
268268
{
269-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
269+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
270270
} | Should Not Throw
271271
}
272272

273273
It "should return a compliant state after being applied" {
274-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
274+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
275275
}
276276
}
277277

@@ -288,12 +288,12 @@ try
288288

289289
It "should apply the MOF correctly" {
290290
{
291-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
291+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
292292
} | Should Not Throw
293293
}
294294

295295
It "should return a compliant state after being applied" {
296-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
296+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
297297
}
298298
}
299299
#endregion
@@ -313,12 +313,12 @@ try
313313

314314
It "should apply the MOF correctly" {
315315
{
316-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
316+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
317317
} | Should Not Throw
318318
}
319319

320320
It "should return a compliant state after being applied" {
321-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
321+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
322322
}
323323
}
324324

@@ -336,12 +336,12 @@ try
336336

337337
It "should apply the MOF correctly" {
338338
{
339-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
339+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
340340
} | Should Not Throw
341341
}
342342

343343
It "should return a compliant state after being applied" {
344-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
344+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
345345
}
346346
}
347347

@@ -358,12 +358,12 @@ try
358358

359359
It "should apply the MOF correctly" {
360360
{
361-
Start-DscConfiguration -Path $ConfigDir -Wait -Force
361+
Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force
362362
} | Should Not Throw
363363
}
364364

365365
It "should return a compliant state after being applied" {
366-
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof).InDesiredState | Should be $true
366+
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
367367
}
368368
}
369369
#endregion

Tests/Unit/MSFT_xScheduledTask.Tests.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ param(
55
$Global:DSCModuleName = 'xComputerManagement'
66
$Global:DSCResourceName = 'MSFT_xScheduledTask'
77

8+
9+
810
#region HEADER
911
# Unit Test Template Version: 1.1.0
1012
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))
@@ -20,6 +22,7 @@ $TestEnvironment = Initialize-TestEnvironment `
2022
-DSCResourceName $Global:DSCResourceName `
2123
-TestType Unit
2224

25+
$VerbosePreference = 'Continue'
2326
# Begin Testing
2427
try
2528
{
@@ -53,7 +56,7 @@ try
5356
}
5457

5558
It "should create the scheduled task in the set method" {
56-
Set-TargetResource @testParams
59+
Set-TargetResource @testParams -Verbose
5760
}
5861
}
5962

@@ -96,7 +99,7 @@ try
9699
}
97100

98101
It "should remove the scheduled task in the set method" {
99-
Set-TargetResource @testParams
102+
Set-TargetResource @testParams -Verbose
100103
Assert-MockCalled Unregister-ScheduledTask
101104
}
102105
}
@@ -158,7 +161,7 @@ try
158161
}
159162

160163
It "should update the scheduled task in the set method" {
161-
Set-TargetResource @testParams
164+
Set-TargetResource @testParams -Verbose
162165
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
163166
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
164167
}
@@ -240,7 +243,7 @@ try
240243
}
241244

242245
It "should update the scheduled task in the set method" {
243-
Set-TargetResource @testParams
246+
Set-TargetResource @testParams -Verbose
244247
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
245248
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
246249
}
@@ -321,7 +324,7 @@ try
321324
}
322325

323326
It "should update the scheduled task in the set method" {
324-
Set-TargetResource @testParams
327+
Set-TargetResource @testParams -Verbose
325328
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
326329
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
327330
}
@@ -400,7 +403,7 @@ try
400403
}
401404

402405
It "should update the scheduled task in the set method" {
403-
Set-TargetResource @testParams
406+
Set-TargetResource @testParams -Verbose
404407
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
405408
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
406409
}
@@ -446,7 +449,7 @@ try
446449
}
447450

448451
It "should update the scheduled task in the set method" {
449-
Set-TargetResource @testParams
452+
Set-TargetResource @testParams -Verbose
450453
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
451454
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
452455
}
@@ -492,7 +495,7 @@ try
492495
}
493496

494497
It "should update the scheduled task in the set method" {
495-
Set-TargetResource @testParams
498+
Set-TargetResource @testParams -Verbose
496499
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
497500
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
498501
}
@@ -541,7 +544,7 @@ try
541544
}
542545

543546
It "should update the scheduled task in the set method" {
544-
Set-TargetResource @testParams
547+
Set-TargetResource @testParams -Verbose
545548
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
546549
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
547550
}
@@ -677,7 +680,7 @@ try
677680
}
678681

679682
It "should update the scheduled task in the set method" {
680-
Set-TargetResource @testParams
683+
Set-TargetResource @testParams -Verbose
681684
Assert-MockCalled -CommandName Unregister-ScheduledTask -Times 1
682685
Assert-Mockcalled -CommandName Register-ScheduledTask -Times 1
683686
}

0 commit comments

Comments
 (0)