diff --git a/CHANGELOG.md b/CHANGELOG.md index 25535db93..2323a1207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Connect-SqlDscDatabaseEngine` - Comment-based help for parameter `LoginType` was corrected. - An integration test now runs to test the command. +- SqlAudit + - Fixed unit tests. +- SqlDatabaseMail + - Fix unit test, removing `Assert-VerifiableMock` that was left over from + Pester 5 conversion. ## [16.6.0] - 2024-05-17 diff --git a/tests/Unit/Classes/SqlAudit.Tests.ps1 b/tests/Unit/Classes/SqlAudit.Tests.ps1 index c9cdc9d71..827a6faa0 100644 --- a/tests/Unit/Classes/SqlAudit.Tests.ps1 +++ b/tests/Unit/Classes/SqlAudit.Tests.ps1 @@ -298,7 +298,7 @@ Describe 'SqlAudit\Set()' -Tag 'Set' { } } - It 'Should not call method Modify()' { + It 'Should call method Modify()' { InModuleScope -ScriptBlock { $script:mockSqlAuditInstance.Set() @@ -346,11 +346,17 @@ Describe 'SqlAudit\Test()' -Tag 'Test' { $script:mockSqlAuditInstance | # Mock method Compare() which is called by the base method Set() Add-Member -Force -MemberType 'ScriptMethod' -Name 'Compare' -Value { - return @{ - Name = 'MockAuditName' - InstanceName = 'NamedInstance' - Path = 'C:\WrongFolder' - } + <# + Compare() method shall only return the properties NOT in + desired state, in the format of the command Compare-DscParameterState. + #> + return @( + @{ + Property = 'Path' + ExpectedValue = 'C:\Temp' + ActualValue = 'C:\WrongFolder' + } + ) } -PassThru | Add-Member -Force -MemberType 'ScriptMethod' -Name 'AssertProperties' -Value { return diff --git a/tests/Unit/DSC_SqlDatabaseMail.Tests.ps1 b/tests/Unit/DSC_SqlDatabaseMail.Tests.ps1 index 82a2b7a14..f9803e2ee 100644 --- a/tests/Unit/DSC_SqlDatabaseMail.Tests.ps1 +++ b/tests/Unit/DSC_SqlDatabaseMail.Tests.ps1 @@ -1141,6 +1141,4 @@ Describe 'DSC_SqlDatabaseMail\Set-TargetResource' -Tag 'Set' { } } } - - Assert-VerifiableMock }