From 995b3f4bac67e15fd451f5a6fce6f3da8d6f6771 Mon Sep 17 00:00:00 2001 From: Robert Simpson Date: Wed, 17 Jun 2020 09:51:50 -0500 Subject: [PATCH] Issue-#333 Moved Get-TargetResource in same "It" block as Set-TargetResource --- tests/Unit/DSC_ScheduledTask.Tests.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Unit/DSC_ScheduledTask.Tests.ps1 b/tests/Unit/DSC_ScheduledTask.Tests.ps1 index 5df253e8..10fdf949 100644 --- a/tests/Unit/DSC_ScheduledTask.Tests.ps1 +++ b/tests/Unit/DSC_ScheduledTask.Tests.ps1 @@ -123,9 +123,12 @@ try Test-TargetResource @testParameters | Should -BeFalse } - It 'Should create the scheduled task in the set method' { + It 'Should create the scheduled task in the set method and return the correct values from Get-TargetResource' { Set-TargetResource @testParameters + $result = Get-TargetResource @getTargetResourceParameters + $result.Ensure | Should -Be 'Present' } + } Context 'No scheduled task exists, but it should, with MultipleInstances = StopExisting' { @@ -149,12 +152,10 @@ try Test-TargetResource @testParameters | Should -BeFalse } - It 'Should create the scheduled task in the set method' { + It 'Should create the scheduled task in the set method and return the correct values from Get-TargetResource' { Set-TargetResource @testParameters - } - - It 'Should return the correct values from Get-TargetResource for updated state' { $result = Get-TargetResource @getTargetResourceParameters + $result.Ensure | Should -Be 'Present' $result.MultipleInstances | Should -Be $testParameters.MultipleInstances }