Skip to content

Commit bb146b6

Browse files
committed
Backup-SqlDscDatabase: Improve readability of backup type descriptions and update expected parameters in tests
1 parent dc1c357 commit bb146b6

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

source/Public/Backup-SqlDscDatabase.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,18 @@ function Backup-SqlDscDatabase
261261
# Determine the backup type description for messages
262262
$backupTypeDescription = switch ($BackupType)
263263
{
264-
'Full' { 'full' }
265-
'Differential' { 'differential' }
266-
'Log' { 'transaction log' }
264+
'Full'
265+
{
266+
'full'
267+
}
268+
'Differential'
269+
{
270+
'differential'
271+
}
272+
'Log'
273+
{
274+
'transaction log'
275+
}
267276
}
268277

269278
$descriptionMessage = $script:localizedData.Database_Backup_ShouldProcessVerboseDescription -f $backupTypeDescription, $Name, $BackupFile

tests/Unit/Public/Backup-SqlDscDatabase.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Describe 'Backup-SqlDscDatabase' -Tag 'Public' {
255255
It 'Should have the correct parameters in parameter set ServerObject' -ForEach @(
256256
@{
257257
ExpectedParameterSetName = 'ServerObject'
258-
ExpectedParameters = '-ServerObject <Server> -Name <string> -BackupFile <string> [-BackupType <string>] [-CopyOnly] [-Compress] [-Checksum] [-Description <string>] [-RetainDays <int>] [-Initialize] [-Refresh] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]'
258+
ExpectedParameters = '-ServerObject <Server> -Name <string> -BackupFile <string> [-BackupType <string>] [-CopyOnly] [-Compress] [-Checksum] [-Description <string>] [-RetainDays <int>] [-Initialize] [-Refresh] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]'
259259
}
260260
) {
261261
$result = (Get-Command -Name 'Backup-SqlDscDatabase').ParameterSets |
@@ -272,7 +272,7 @@ Describe 'Backup-SqlDscDatabase' -Tag 'Public' {
272272
It 'Should have the correct parameters in parameter set DatabaseObject' -ForEach @(
273273
@{
274274
ExpectedParameterSetName = 'DatabaseObject'
275-
ExpectedParameters = '-DatabaseObject <Database> -BackupFile <string> [-BackupType <string>] [-CopyOnly] [-Compress] [-Checksum] [-Description <string>] [-RetainDays <int>] [-Initialize] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]'
275+
ExpectedParameters = '-DatabaseObject <Database> -BackupFile <string> [-BackupType <string>] [-CopyOnly] [-Compress] [-Checksum] [-Description <string>] [-RetainDays <int>] [-Initialize] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]'
276276
}
277277
) {
278278
$result = (Get-Command -Name 'Backup-SqlDscDatabase').ParameterSets |

0 commit comments

Comments
 (0)