Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PlagueHO/d1f47fba25efc2a6afb9 to your computer and use it in GitHub Desktop.
Save PlagueHO/d1f47fba25efc2a6afb9 to your computer and use it in GitHub Desktop.
Example DSC Resource Unit Tests for Test-TargetResource where does not exist but should
Context 'Virtual Disk does not exist but should' {
Mock Get-iSCSIVirtualDisk
It 'should return false' {
$Splat = $TestVirtualDisk.Clone()
Test-TargetResource @Splat | Should Be $False
}
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