Skip to content

Commit

Permalink
removed white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 27, 2024
1 parent e1e2e94 commit 9c51c8f
Show file tree
Hide file tree
Showing 48 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion tests/Expand-DbaDbLogFile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Describe "Expand-DbaDbLogFile" -Tag "IntegrationTests" {
}

It "Has required properties" {
$required = 'ComputerName', 'InstanceName', 'SqlInstance', 'Database', 'ID', 'Name',
$required = 'ComputerName', 'InstanceName', 'SqlInstance', 'Database', 'ID', 'Name',
'LogFileCount', 'InitialSize', 'CurrentSize', 'InitialVLFCount', 'CurrentVLFCount'
$results[0].PSObject.Properties.Name | Should -Contain $_ -ForEach $required
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Export-DbaBinaryFile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Describe "Export-DbaBinaryFile" -Tag "IntegrationTests" {
$testDb = Get-DbaDatabase -SqlInstance $TestConfig.instance2 -Database tempdb
$testTable = "BunchOFilezz"
$exportPath = "C:\temp\exports"

$null = $testDb.Query("CREATE TABLE [dbo].[$testTable]([FileName123] [nvarchar](50) NULL, [TheFile123] [image] NULL)")
$null = Import-DbaBinaryFile -SqlInstance $TestConfig.instance2 -Database tempdb -Table $testTable -FilePath "$($TestConfig.appveyorlabrepo)\azure\adalsql.msi"
$null = Get-ChildItem "$($TestConfig.appveyorlabrepo)\certificates" | Import-DbaBinaryFile -SqlInstance $TestConfig.instance2 -Database tempdb -Table $testTable
Expand Down Expand Up @@ -71,7 +71,7 @@ Describe "Export-DbaBinaryFile" -Tag "IntegrationTests" {

Context "When exporting binary files through pipeline" {
BeforeAll {
$results = Get-DbaBinaryFileTable -SqlInstance $TestConfig.instance2 -Database tempdb |
$results = Get-DbaBinaryFileTable -SqlInstance $TestConfig.instance2 -Database tempdb |
Export-DbaBinaryFile -Path $exportPath
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaDacPackage.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe "Export-DbaDacPackage" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"ExcludeDatabase",
"AllUserDatabases",
Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaDbRole.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Describe "Export-DbaDbRole" -Tag "IntegrationTests" {
BeforeAll {
$AltExportPath = "$env:USERPROFILE\Documents"
$outputFile1 = "$AltExportPath\Dbatoolsci_DbRole_CustomFile1.sql"

$random = Get-Random
$dbname1 = "dbatoolsci_exportdbadbrole$random"
$login1 = "dbatoolsci_exportdbadbrole_login1$random"
Expand Down
4 changes: 2 additions & 2 deletions tests/Export-DbaDbTableData.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Describe "Export-DbaDbTableData" -Tags "IntegrationTests" {
BeforeAll {
$escaped = [regex]::escape('INSERT [dbo].[dbatoolsci_example] ([id]) VALUES (1)')
$secondEscaped = [regex]::escape('INSERT [dbo].[dbatoolsci_temp] ([name], [database_id],')
$results = Get-DbaDbTable -SqlInstance $TestConfig.Instance1 -Database tempdb -Table dbatoolsci_example |
$results = Get-DbaDbTable -SqlInstance $TestConfig.Instance1 -Database tempdb -Table dbatoolsci_example |
Export-DbaDbTableData -Passthru
}

Expand All @@ -72,7 +72,7 @@ Describe "Export-DbaDbTableData" -Tags "IntegrationTests" {
BeforeAll {
$escaped = [regex]::escape('INSERT [dbo].[dbatoolsci_example] ([id]) VALUES (1)')
$secondEscaped = [regex]::escape('INSERT [dbo].[dbatoolsci_temp] ([name], [database_id],')
$results = Get-DbaDbTable -SqlInstance $TestConfig.Instance1 -Database tempdb -Table dbatoolsci_example, dbatoolsci_temp |
$results = Get-DbaDbTable -SqlInstance $TestConfig.Instance1 -Database tempdb -Table dbatoolsci_example, dbatoolsci_temp |
Export-DbaDbTableData -Passthru
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaDiagnosticQuery.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Describe "Export-DbaDiagnosticQuery" -Tag "IntegrationTests" {

Context "When exporting diagnostic query results" {
BeforeAll {
$null = Invoke-DbaDiagnosticQuery -SqlInstance $TestConfig.Instance2 -QueryName "Memory Clerk Usage" |
$null = Invoke-DbaDiagnosticQuery -SqlInstance $TestConfig.Instance2 -QueryName "Memory Clerk Usage" |
Export-DbaDiagnosticQuery -Path $testPath
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Export-DbaRegServer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe "Export-DbaRegServer" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"InputObject",
"Path",
"FilePath",
Expand Down Expand Up @@ -62,7 +62,7 @@ Describe "Export-DbaRegServer" -Tag "IntegrationTests" {

$group1 = Add-DbaRegServerGroup -SqlInstance $TestConfig.instance2 -Name "dbatoolsci-group1"
$group2 = Add-DbaRegServerGroup -SqlInstance $TestConfig.instance2 -Name "dbatoolsci-group2"

$server1 = Add-DbaRegServer @splatServer1
$server2 = Add-DbaRegServer @splatServer2
$server3 = Add-DbaRegServer @splatServer3
Expand All @@ -71,7 +71,7 @@ Describe "Export-DbaRegServer" -Tag "IntegrationTests" {
AfterAll {
Get-DbaRegServer -SqlInstance $TestConfig.instance2 | Where-Object Name -Match dbatoolsci | Remove-DbaRegServer -Confirm:$false
Get-DbaRegServerGroup -SqlInstance $TestConfig.instance2 | Where-Object Name -Match dbatoolsci | Remove-DbaRegServerGroup -Confirm:$false

if (Test-Path $newDirectory) {
Remove-Item $newDirectory -Recurse -Force
}
Expand All @@ -95,7 +95,7 @@ Describe "Export-DbaRegServer" -Tag "IntegrationTests" {
$exportPath = $server3 | Export-DbaRegServer -Path C:\temp
Get-DbaRegServer -SqlInstance $TestConfig.instance2 | Where-Object Name -Match dbatoolsci | Remove-DbaRegServer -Confirm:$false
Get-DbaRegServerGroup -SqlInstance $TestConfig.instance2 | Where-Object Name -Match dbatoolsci | Remove-DbaRegServerGroup -Confirm:$false

$importedServer = Import-DbaRegServer -SqlInstance $TestConfig.instance2 -Path $exportPath
$importedServer.ServerName | Should -Be $splatServer3.ServerName
$importedServer.Description | Should -Be $splatServer3.Description
Expand Down
6 changes: 3 additions & 3 deletions tests/Export-DbaScript.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe "Export-DbaScript" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"InputObject",
"ScriptingOptionsObject",
"ScriptingOptionsObject",
"Path",
"FilePath",
"Encoding",
Expand Down Expand Up @@ -69,8 +69,8 @@ Describe "Export-DbaScript" -Tag "IntegrationTests" {
Context "When using NoPrefix parameter" {
BeforeAll {
$testPath = "C:\temp"
if (-not (Test-Path $testPath)) {
$null = New-Item -ItemType Directory -Path $testPath
if (-not (Test-Path $testPath)) {
$null = New-Item -ItemType Directory -Path $testPath
}
$outputFile = Join-Path $testPath "msdb.txt"
$table = Get-DbaDbTable -SqlInstance $TestConfig.instance2 -Database msdb | Select-Object -First 1
Expand Down
2 changes: 1 addition & 1 deletion tests/Export-DbaSysDbUserObject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Describe "Export-DbaSysDbUserObject" -Tag "IntegrationTests" {
$tableFunctionName = "[dbatoolsci_TableFunction_$random]"
$scalarFunctionName = "[dbatoolsci_ScalarFunction_$random]"
$ruleName = "[dbatoolsci_Rule_$random]"

$server = Connect-DbaInstance -SqlInstance $TestConfig.instance2 -SqlCredential $SqlCredential
$server.query("CREATE TABLE dbo.$tableName (Col1 int);", "master")
$server.query("CREATE VIEW dbo.$viewName AS SELECT 1 as Col1;", "master")
Expand Down
6 changes: 3 additions & 3 deletions tests/Export-DbaXESession.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Export-DbaXESession" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"InputObject",
"Session",
"Path",
Expand Down Expand Up @@ -42,7 +42,7 @@ Describe "Export-DbaXESession" -Tag "IntegrationTests" {
$AltExportPath = "$env:USERPROFILE\Documents"
$outputFile = "$AltExportPath\Dbatoolsci_XE_CustomFile.sql"
}

AfterAll {
Get-ChildItem $outputFile -ErrorAction SilentlyContinue | Remove-Item -ErrorAction SilentlyContinue
}
Expand Down Expand Up @@ -77,7 +77,7 @@ Describe "Export-DbaXESession" -Tag "IntegrationTests" {

Context "When using pipeline input" {
BeforeAll {
$null = Get-DbaXESession -SqlInstance $TestConfig.Instance2 -Session system_health |
$null = Get-DbaXESession -SqlInstance $TestConfig.Instance2 -Session system_health |
Export-DbaXESession -FilePath $outputFile
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Find-DbaAgentJob.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Describe "Find-DbaAgentJob" -Tag "UnitTests" {
'StepName',
'LastUsed',
'IsDisabled',
'IsFailed',
'IsFailed',
'IsNotScheduled',
'IsNoEmailNotification',
'Category',
Expand All @@ -42,7 +42,7 @@ Describe "Find-DbaAgentJob" -Tags "IntegrationTests" {
Context "Command finds jobs using all parameters" {
BeforeAll {
$srvName = Invoke-DbaQuery -SqlInstance $TestConfig.instance2 -Query "select @@servername as sn" -as PSObject

# Create test job
$splatJob = @{
SqlInstance = $TestConfig.instance2
Expand Down
8 changes: 4 additions & 4 deletions tests/Find-DbaBackup.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ Describe "Find-DbaBackup" -Tag "IntegrationTests" {

Context "Path validation" {
It "Throws when path is invalid" {
{ Find-DbaBackup -Path 'funnypath' -BackupFileExtension 'bak' -RetentionPeriod '0d' -EnableException } |
{ Find-DbaBackup -Path 'funnypath' -BackupFileExtension 'bak' -RetentionPeriod '0d' -EnableException } |
Should -Throw "not found"
}
}

Context "RetentionPeriod validation" {
It "Throws when retention period format is invalid" {
{ Find-DbaBackup -Path $testPath -BackupFileExtension 'bak' -RetentionPeriod 'ad' -EnableException } |
{ Find-DbaBackup -Path $testPath -BackupFileExtension 'bak' -RetentionPeriod 'ad' -EnableException } |
Should -Throw "format invalid"
}

It "Throws when retention period units are invalid" {
{ Find-DbaBackup -Path $testPath -BackupFileExtension 'bak' -RetentionPeriod '11y' -EnableException } |
{ Find-DbaBackup -Path $testPath -BackupFileExtension 'bak' -RetentionPeriod '11y' -EnableException } |
Should -Throw "units invalid"
}
}

Context "BackupFileExtension validation" {
It "Does not throw with valid extension" {
{ Find-DbaBackup -Path $testPath -BackupFileExtension '.bak' -RetentionPeriod '0d' -EnableException -WarningAction SilentlyContinue } |
{ Find-DbaBackup -Path $testPath -BackupFileExtension '.bak' -RetentionPeriod '0d' -EnableException -WarningAction SilentlyContinue } |
Should -Not -Throw
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Find-DbaDatabase.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe "Find-DbaDatabase" -Tag "UnitTests" {
$command = Get-Command Find-DbaDatabase
$knownParameters = @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Property",
"Pattern",
"Exact",
Expand All @@ -26,7 +26,7 @@ Describe "Find-DbaDatabase" -Tag "UnitTests" {
}

It "Should have exactly the number of parameters ($($knownParameters.Count))" {
$params = $command.Parameters.Values.Name
$params = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $knownParameters -DifferenceObject $params | Should -BeNullOrEmpty
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaDbDisabledIndex.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Find-DbaDbDisabledIndex" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"ExcludeDatabase",
"NoClobber",
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaDbDuplicateIndex.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe "Find-DbaDbDuplicateIndex" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"IncludeOverlapping",
"EnableException"
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaDbGrowthEvent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe "Find-DbaDbGrowthEvent" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"ExcludeDatabase",
"EventType",
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaOrphanedFile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Find-DbaOrphanedFile" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
'SqlInstance',
'SqlCredential',
'SqlCredential',
'Path',
'FileType',
'LocalOnly',
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaStoredProcedure.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Find-DbaStoredProcedure" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"ExcludeDatabase",
"Pattern",
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaTrigger.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Find-DbaTrigger" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
'SqlInstance',
'SqlCredential',
'SqlCredential',
'Database',
'ExcludeDatabase',
'Pattern',
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaUserObject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Describe "Find-DbaUserObject" -Tag "IntegrationTests" {
$null = New-DbaDatabase -SqlInstance $TestConfig.instance2 -Name 'dbatoolsci_userObject' -Owner 'sa'
$results = Find-DbaUserObject -SqlInstance $TestConfig.instance2 -Pattern sa
}

AfterAll {
$null = Remove-DbaDatabase -SqlInstance $TestConfig.instance2 -Database 'dbatoolsci_userObject' -Confirm:$false
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Find-DbaView.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe "Find-DbaView" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Database",
"ExcludeDatabase",
"Pattern",
Expand Down
4 changes: 2 additions & 2 deletions tests/Get-DbaAgBackupHistory.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Get-DbaAgBackupHistory" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"AvailabilityGroup",
"Database",
"ExcludeDatabase",
Expand All @@ -20,7 +20,7 @@ Describe "Get-DbaAgBackupHistory" -Tag "UnitTests" {
"RecoveryFork",
"Last",
"LastFull",
"LastDiff",
"LastDiff",
"LastLog",
"DeviceType",
"Raw",
Expand Down
2 changes: 1 addition & 1 deletion tests/Get-DbaAgDatabase.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe "Get-DbaAgDatabase" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"AvailabilityGroup",
"Database",
"InputObject",
Expand Down
2 changes: 1 addition & 1 deletion tests/Get-DbaAgListener.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Describe "Get-DbaAgListener" -Tag "UnitTests" {
$command = Get-Command Get-DbaAgListener
$knownParameters = @(
'SqlInstance',
'SqlCredential',
'SqlCredential',
'AvailabilityGroup',
'Listener',
'InputObject',
Expand Down
2 changes: 1 addition & 1 deletion tests/Get-DbaAgReplica.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe "Get-DbaAgReplica" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"AvailabilityGroup",
"Replica",
"InputObject",
Expand Down
6 changes: 3 additions & 3 deletions tests/Get-DbaAgentAlertCategory.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Describe "Get-DbaAgentAlertCategory" -Tag "UnitTests" {
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"SqlCredential",
"Category",
"EnableException"
)
Expand All @@ -36,7 +36,7 @@ Describe "Get-DbaAgentAlertCategory" -Tag "IntegrationTests" {
)
$null = New-DbaAgentAlertCategory -SqlInstance $TestConfig.instance2 -Category $categories
}

AfterAll {
$null = Remove-DbaAgentAlertCategory -SqlInstance $TestConfig.instance2 -Category $categories -Confirm:$false
}
Expand All @@ -53,7 +53,7 @@ Describe "Get-DbaAgentAlertCategory" -Tag "IntegrationTests" {

Context "When getting a specific alert category" {
BeforeAll {
$results = Get-DbaAgentAlertCategory -SqlInstance $TestConfig.instance2 -Category dbatoolsci_testcategory |
$results = Get-DbaAgentAlertCategory -SqlInstance $TestConfig.instance2 -Category dbatoolsci_testcategory |
Where-Object Name -match "dbatoolsci"
}

Expand Down
Loading

0 comments on commit 9c51c8f

Please sign in to comment.