Skip to content

Commit e42f26a

Browse files
committed
debug integ test
1 parent 1c81119 commit e42f26a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/Integration/Resources/DSCv3_DebugDscEngine.Integration.Tests.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,28 @@ Describe "$($script:dscResourceFriendlyName)_Integration" -Tag @('Integration_SQ
4545
}
4646

4747
Context 'When getting the current state of the resource' {
48+
It 'DEBUG - WILL THIS FAIL? - Should return the expected current state with all properties' {
49+
$desiredParameters = @{
50+
KeyProperty = 'TEST_KEY_002'
51+
MandatoryProperty = 'TestMandatoryValue'
52+
WriteProperty = 'DesiredWriteValue'
53+
}
54+
55+
$result = dsc --trace-level trace resource get --resource SqlServerDsc/DebugDscEngine --output-format json --input ($desiredParameters | ConvertTo-Json -Compress) | ConvertFrom-Json
56+
57+
$dscExitCode = $LASTEXITCODE # cSpell: ignore LASTEXITCODE
58+
59+
if ($dscExitCode -ne 0)
60+
{
61+
throw ('DSC executable failed with exit code {0}.' -f $dscExitCode)
62+
}
63+
64+
$result.actualState.KeyProperty | Should -Be 'TEST_KEY_002'
65+
$result.actualState.MandatoryProperty | Should -Be 'CurrentMandatoryStateValue'
66+
$result.actualState.WriteProperty | Should -Be 'CurrentStateValue'
67+
$result.actualState.ReadProperty | Should -Match '^ReadOnlyValue_\d{8}_\d{6}$'
68+
}
69+
4870
It 'Should return the expected current state with minimal properties' {
4971
$desiredParameters = @{
5072
KeyProperty = 'TEST_KEY_001'

0 commit comments

Comments
 (0)