Skip to content

Commit e0640f0

Browse files
committed
Remove redundant tests for SetSnapshotIsolation in Enable-SqlDscDatabaseSnapshotIsolation
1 parent 51ac093 commit e0640f0

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

tests/Unit/Public/Enable-SqlDscDatabaseSnapshotIsolation.Tests.ps1

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,6 @@ Describe 'Enable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
158158

159159
$mockDatabaseObject.SnapshotIsolationState | Should -Be 'Enabled'
160160
}
161-
162-
It 'Should call SetSnapshotIsolation with true' {
163-
# Reset state for this test
164-
$mockDatabaseObject.SnapshotIsolationState = 'Disabled'
165-
$script:setSnapshotIsolationCalled = $false
166-
$script:setSnapshotIsolationValue = $null
167-
168-
$null = Enable-SqlDscDatabaseSnapshotIsolation -ServerObject $mockServerObject -Name 'TestDatabase' -Force
169-
170-
$mockDatabaseObject.SnapshotIsolationState | Should -Be 'Enabled'
171-
$script:setSnapshotIsolationCalled | Should -BeTrue -Because 'SetSnapshotIsolation should be called'
172-
$script:setSnapshotIsolationValue | Should -BeTrue -Because 'SetSnapshotIsolation should be called with $true'
173-
}
174161
}
175162

176163
Context 'When enabling snapshot isolation using DatabaseObject' {
@@ -230,18 +217,6 @@ Describe 'Enable-SqlDscDatabaseSnapshotIsolation' -Tag 'Public' {
230217
$result | Should -Not -BeNullOrEmpty
231218
$result.Name | Should -Be 'TestDatabase'
232219
}
233-
234-
It 'Should call SetSnapshotIsolation with true' {
235-
$mockDatabaseObject.SnapshotIsolationState = 'Disabled'
236-
$script:setSnapshotIsolationCalled = $false
237-
$script:setSnapshotIsolationValue = $null
238-
239-
$null = Enable-SqlDscDatabaseSnapshotIsolation -DatabaseObject $mockDatabaseObject -Force
240-
241-
$mockDatabaseObject.SnapshotIsolationState | Should -Be 'Enabled'
242-
$script:setSnapshotIsolationCalled | Should -BeTrue -Because 'SetSnapshotIsolation should be called'
243-
$script:setSnapshotIsolationValue | Should -BeTrue -Because 'SetSnapshotIsolation should be called with $true'
244-
}
245220
}
246221

247222
Context 'When snapshot isolation is already enabled' {

0 commit comments

Comments
 (0)