Created
December 23, 2015 05:33
-
-
Save PlagueHO/782db99150f72e90f0b5 to your computer and use it in GitHub Desktop.
Example DSC Resource Unit Tests for Test-TargetResource where does exist and should but has a different description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context 'Virtual Disk exists and should but has a different Description' { | |
Mock Get-iSCSIVirtualDisk -MockWith { return @($MockVirtualDisk) } | |
It 'should return false' { | |
{ | |
$Splat = $TestVirtualDisk.Clone() | |
$Splat.Description = 'Different' | |
Test-TargetResource @Splat | Should Be $False | |
} | Should Not Throw | |
} | |
It 'should call expected Mocks' { | |
Assert-MockCalled -commandName Get-iSCSIVirtualDisk -Exactly 1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment