Skip to content

Commit

Permalink
Add Tests is everything is ok and nothing is to do (test-TargetResour…
Browse files Browse the repository at this point in the history
…ce --> true)
  • Loading branch information
sandrola committed Apr 2, 2024
1 parent 2c85c5a commit 87dcb31
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,36 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}
}

Context -Name 'Configuration is correct, nothing to do' -Fixture {
BeforeAll {
$testParams = @{
Name = 'Contoso Role Group'
Members = 'Group1', 'User1', 'User2'
Description = 'This is the Contoso Role Group'
Ensure = 'Present'
Credential = $Credential
}

Mock -CommandName Get-RoleGroup -MockWith {
return @{
Name = 'Contoso Role Group'
Members = 'Group1', 'User1', 'User2'
Description = 'This is the Contoso Role Group'
}
}

Mock -CommandName Get-RoleGroupMember -MockWith {
return @{
Name = @('Group1','User1','User2')
}
}
}

It 'Should return true from the Test method' {
Test-TargetResource @testParams | Should -Be $true
}
}

Context -Name 'ReverseDSC Tests' -Fixture {
BeforeAll {
$Global:CurrentModeIsExport = $true
Expand Down

0 comments on commit 87dcb31

Please sign in to comment.