I have implemented several DSC resources but now I need to devise a way to test them. What I found as possible options are:
Unit testing of the underlying PowerShell code i.e. Get-, Test-, Set-TargetResource methodsIntegration test that starts a VM, applies the DSC resource and asserts whether everything is in placeUsing the WhatIf switch of the Start-DscConfiguration method to look for specific messages – but this not real functional testingUsing the Test-DscConfiguration to verify that the changes are applied correctly and the machine state is the correct one
I would like to know whether this is the correct way to test the DSC resource and if there is something better as an approach.