@@ -98,7 +98,7 @@ Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
9898 } - Force
9999 }
100100
101- It ' Should disable snapshot isolation successfully ' {
101+ It ' Should call SetSnapshotIsolation with false and change state to Disabled ' {
102102 $script :setSnapshotIsolationCalled = $false
103103 $script :setSnapshotIsolationValue = $null
104104 $null = Disable-SqlDscDatabaseSnapshotIsolation - ServerObject $mockServerObject - Name ' TestDatabase' - Force
@@ -123,17 +123,6 @@ Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
123123 $null = Disable-SqlDscDatabaseSnapshotIsolation - ServerObject $mockServerObject - Name ' TestDatabase' - Force - Refresh
124124 $mockDatabaseObject.SnapshotIsolationState | Should - Be ' Disabled'
125125 }
126-
127- It ' Should call SetSnapshotIsolation with false' {
128- # Reset state for this test
129- $mockDatabaseObject.SnapshotIsolationState = ' Enabled'
130- $script :setSnapshotIsolationCalled = $false
131- $script :setSnapshotIsolationValue = $null
132- $null = Disable-SqlDscDatabaseSnapshotIsolation - ServerObject $mockServerObject - Name ' TestDatabase' - Force
133- $mockDatabaseObject.SnapshotIsolationState | Should - Be ' Disabled'
134- $script :setSnapshotIsolationCalled | Should - BeTrue - Because ' SetSnapshotIsolation should be called'
135- $script :setSnapshotIsolationValue | Should - BeFalse - Because ' SetSnapshotIsolation should be called with $false'
136- }
137126 }
138127
139128 Context ' When disabling snapshot isolation using DatabaseObject' {
@@ -166,7 +155,7 @@ Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
166155 } - Force
167156 }
168157
169- It ' Should disable snapshot isolation successfully ' {
158+ It ' Should call SetSnapshotIsolation with false and change state to Disabled ' {
170159 $script :setSnapshotIsolationCalled = $false
171160 $script :setSnapshotIsolationValue = $null
172161 $null = Disable-SqlDscDatabaseSnapshotIsolation - DatabaseObject $mockDatabaseObject - Force
@@ -183,16 +172,6 @@ Describe 'Disable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
183172 $result | Should -Not - BeNullOrEmpty
184173 $result.Name | Should - Be ' TestDatabase'
185174 }
186-
187- It ' Should call SetSnapshotIsolation with false' {
188- $mockDatabaseObject.SnapshotIsolationState = ' Enabled'
189- $script :setSnapshotIsolationCalled = $false
190- $script :setSnapshotIsolationValue = $null
191- $null = Disable-SqlDscDatabaseSnapshotIsolation - DatabaseObject $mockDatabaseObject - Force
192- $mockDatabaseObject.SnapshotIsolationState | Should - Be ' Disabled'
193- $script :setSnapshotIsolationCalled | Should - BeTrue - Because ' SetSnapshotIsolation should be called'
194- $script :setSnapshotIsolationValue | Should - BeFalse - Because ' SetSnapshotIsolation should be called with $false'
195- }
196175 }
197176
198177 Context ' When snapshot isolation is already disabled' {
0 commit comments