Skip to content

Commit 30d9e6f

Browse files
committed
Enhance error handling in New-SqlDscLogin.Tests by enforcing module import failure checks
1 parent 8dac769 commit 30d9e6f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/Unit/Public/New-SqlDscLogin.Tests.ps1

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BeforeAll {
2929

3030
$env:SqlServerDscCI = $true
3131

32-
Import-Module -Name $script:dscModuleName -Force
32+
Import-Module -Name $script:dscModuleName -Force -ErrorAction 'Stop'
3333

3434
# Loading mocked classes
3535
Add-Type -Path (Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath '../Stubs') -ChildPath 'SMO.cs')
@@ -308,10 +308,6 @@ Describe 'New-SqlDscLogin' -Tag 'Public' {
308308

309309
Should -Invoke -CommandName Test-SqlDscIsLogin -Exactly -Times 1 -Scope It
310310
}
311-
312-
It 'Should call Create method on login object' {
313-
New-SqlDscLogin -ServerObject $script:mockServerObject -Name 'TestLogin' -SqlLogin -SecurePassword $script:mockSecurePassword -Confirm:$false
314-
}
315311
}
316312

317313
Context 'When creating a Windows user login' {

0 commit comments

Comments
 (0)