Skip to content

Commit 5dec387

Browse files
Normalize whitespace in test scripts
Replaces inconsistent whitespace and blank lines in various test files to improve code readability and maintain consistent formatting. No functional changes were made.
1 parent 1e8e4fe commit 5dec387

16 files changed

+51
-51
lines changed

tests/Get-DbaBuild.Tests.ps1

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,28 @@ Describe $CommandName -Tag UnitTests {
4848
$IdxRef | Should -BeOfType System.Object
4949
}
5050
}
51-
51+
5252
Context "Validate LastUpdated property" {
5353
BeforeAll {
5454
$IdxRef = Get-Content $idxfile -Raw | ConvertFrom-Json
5555
}
56-
56+
5757
It "Has a proper LastUpdated property" {
5858
$lastupdate = Get-Date -Date $IdxRef.LastUpdated
5959
$lastupdate | Should -BeOfType System.DateTime
6060
}
61-
61+
6262
It "LastUpdated is updated regularly (keeps everybody on their toes)" {
6363
$lastupdate = Get-Date -Date $IdxRef.LastUpdated
6464
$lastupdate | Should -BeGreaterThan (Get-Date).AddDays(-45)
6565
}
66-
66+
6767
It "LastUpdated is not in the future" {
6868
$lastupdate = Get-Date -Date $IdxRef.LastUpdated
6969
$lastupdate | Should -BeLessThan (Get-Date)
7070
}
7171
}
72-
72+
7373
Context "Validate Data property" {
7474
BeforeAll {
7575
$IdxRef = Get-Content $idxfile -Raw | ConvertFrom-Json
@@ -84,17 +84,17 @@ Describe $CommandName -Tag UnitTests {
8484
$null = $Groups[$ver].Add($el)
8585
}
8686
}
87-
87+
8888
It "Data is a proper array" {
8989
$IdxRef.Data.Length | Should -BeGreaterThan 100
9090
}
91-
91+
9292
It "Each Datum has a Version property" {
9393
$DataLength = $IdxRef.Data.Length
9494
$DataWithVersion = @($IdxRef.Data.Version | Where-Object { $PSItem }).Count
9595
$DataLength | Should -Be $DataWithVersion
9696
}
97-
97+
9898
It "Each version is correctly parsable" {
9999
$Versions = $IdxRef.Data.Version | Where-Object { $PSItem }
100100
foreach ($ver in $Versions) {
@@ -115,7 +115,7 @@ Describe $CommandName -Tag UnitTests {
115115
}
116116
}
117117
}
118-
118+
119119
It "Versions are ordered, the way versions are ordered" {
120120
$Versions = $IdxRef.Data.Version | Where-Object { $PSItem }
121121
$Naturalized = $Versions | ForEach-Object {
@@ -125,13 +125,13 @@ Describe $CommandName -Tag UnitTests {
125125
$SortedVersions = $Naturalized | Sort-Object
126126
($SortedVersions -join ",") | Should -Be ($Naturalized -join ",")
127127
}
128-
128+
129129
It "Names are at least 8" {
130130
$Names = $IdxRef.Data.Name | Where-Object { $PSItem }
131131
$Names.Count | Should -BeGreaterThan 7
132132
}
133133
}
134-
134+
135135
Context "Params mutual exclusion" {
136136
It "Doesn't accept 'Build', 'Kb', 'SqlInstance" {
137137
{ Get-DbaBuild -Build "10.0.1600" -Kb "4052908" -SqlInstance "localhost" -EnableException -ErrorAction Stop } | Should -Throw
@@ -161,7 +161,7 @@ Describe $CommandName -Tag UnitTests {
161161
{ Get-DbaBuild -CumulativeUpdate "CU2" -EnableException -ErrorAction Stop } | Should -Throw
162162
}
163163
}
164-
164+
165165
Context "Passing just -Update works, see #6823" {
166166
It "works with -Update" {
167167
function Get-DbaBuildReferenceIndexOnline { }
@@ -170,7 +170,7 @@ Describe $CommandName -Tag UnitTests {
170170
$warnings | Should -BeNullOrEmpty
171171
}
172172
}
173-
173+
174174
Context "Retired KBs" {
175175
It "Handles retired KBs" {
176176
$result = Get-DbaBuild -Build "13.0.5479"
@@ -191,7 +191,7 @@ Describe $CommandName -Tag UnitTests {
191191
$result2008R2.MatchType | Should -Be "Exact"
192192
}
193193
}
194-
194+
195195
# These are groups by major release (aka "Name")
196196
Context "Properties Check" {
197197
BeforeAll {
@@ -207,7 +207,7 @@ Describe $CommandName -Tag UnitTests {
207207
$null = $Groups[$ver].Add($el)
208208
}
209209
}
210-
210+
211211
foreach ($g in $OrderedKeys) {
212212
$Versions = $Groups[$g]
213213
Context "Properties Check, for major release $g" {
@@ -257,22 +257,22 @@ Describe $CommandName -Tag IntegrationTests {
257257
$server1 = Connect-DbaInstance -SqlInstance $TestConfig.instance1
258258
$server2 = Connect-DbaInstance -SqlInstance $TestConfig.instance2
259259
}
260-
260+
261261
It "works when instances are piped" {
262262
$res = @($server1, $server2) | Get-DbaBuild
263263
$res.Count | Should -Be 2
264264
}
265-
265+
266266
It "doesn't work when passed both piped instances and, e.g., -Kb (params mutual exclusion)" {
267267
{ @($server1, $server2) | Get-DbaBuild -Kb -EnableException } | Should -Throw
268268
}
269269
}
270-
270+
271271
Context "Test retrieving version from instances" {
272272
BeforeAll {
273273
$results = Get-DbaBuild -SqlInstance $TestConfig.instance1, $TestConfig.instance2
274274
}
275-
275+
276276
It "Should return an exact match" {
277277
$results | Should -Not -BeNullOrEmpty
278278
foreach ($r in $results) {

tests/Get-DbaClientAlias.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Describe $CommandName -Tag IntegrationTests {
3030
BeforeAll {
3131
$newAlias = New-DbaClientAlias -ServerName sql2016 -Alias dbatoolscialias -Verbose:$false
3232
}
33-
33+
3434
AfterAll {
3535
$newAlias | Remove-DbaClientAlias -ErrorAction SilentlyContinue
3636
}
@@ -39,7 +39,7 @@ Describe $CommandName -Tag IntegrationTests {
3939
BeforeAll {
4040
$results = Get-DbaClientAlias
4141
}
42-
42+
4343
It "returns accurate information" {
4444
$results.AliasName -contains "dbatoolscialias" | Should -Be $true
4545
}

tests/Get-DbaComputerCertificate.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ Describe $CommandName -Tag IntegrationTests {
3636
BeforeAll {
3737
$null = Add-DbaComputerCertificate -Path "$($TestConfig.appveyorlabrepo)\certificates\localhost.crt" -Confirm:$false
3838
$thumbprint = "29C469578D6C6211076A09CEE5C5797EEA0C2713"
39-
39+
4040
# Get all certificates once for testing
4141
$allCertificates = Get-DbaComputerCertificate
4242
$specificCertificate = Get-DbaComputerCertificate -Thumbprint $thumbprint
4343
}
44-
44+
4545
AfterAll {
4646
Remove-DbaComputerCertificate -Thumbprint $thumbprint -Confirm:$false -ErrorAction SilentlyContinue
4747
}
@@ -53,7 +53,7 @@ Describe $CommandName -Tag IntegrationTests {
5353
It "returns all certificates and at least one has the specified thumbprint" {
5454
"$($allCertificates.Thumbprint)" -match $thumbprint | Should -Be $true
5555
}
56-
56+
5757
It "returns all certificates and at least one has the specified EnhancedKeyUsageList" {
5858
"$($allCertificates.EnhancedKeyUsageList)" -match "1\.3\.6\.1\.5\.5\.7\.3\.1" | Should -Be $true
5959
}

tests/Get-DbaComputerSystem.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0" }
22
param(
33
$ModuleName = "dbatools",
4-
$CommandName = "Get-DbaComputerSystem", # Static command name for dbatools
4+
$CommandName = "Get-DbaComputerSystem", # Static command name for dbatools
55
$PSDefaultParameterValues = $TestConfig.Defaults
66
)
77

tests/Get-DbaConnectedInstance.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Describe $CommandName -Tag IntegrationTests {
2121
BeforeAll {
2222
$null = Get-DbaDatabase -SqlInstance $TestConfig.instance1
2323
}
24-
24+
2525
Context "gets connected objects" {
2626
It "returns some results" {
2727
$results = Get-DbaConnectedInstance

tests/Get-DbaConnection.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ Describe $CommandName -Tag IntegrationTests {
3434
}
3535
}
3636
}
37-
}
37+
}

tests/Get-DbaDBFileGroup.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Describe $CommandName -Tag IntegrationTests {
4242
# Set variables. They are available in all the It blocks.
4343
$random = Get-Random
4444
$multifgdb = "dbatoolsci_multifgdb$random"
45-
45+
4646
# Remove any existing database before creating
4747
Remove-DbaDatabase -Confirm:$false -SqlInstance $TestConfig.instance2 -Database $multifgdb
4848

tests/Get-DbaDbCheckConstraint.Tests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Describe $CommandName -Tag IntegrationTests {
4141
$testTableName2 = "dbatools_getdbtbl2"
4242
$testCkName = "dbatools_getdbck"
4343
$testDbName = "dbatoolsci_getdbfk$random"
44-
44+
4545
$testServer.Query("CREATE DATABASE $testDbName")
4646
$testServer.Query("CREATE TABLE $testTableName1 (idTbl1 INT PRIMARY KEY)", $testDbName)
4747
$testServer.Query("CREATE TABLE $testTableName2 (idTbl2 INT, idTbl1 INT, id3 INT)", $testDbName)
@@ -66,21 +66,21 @@ Describe $CommandName -Tag IntegrationTests {
6666
$results = Get-DbaDbCheckConstraint -SqlInstance $TestConfig.instance2 -ExcludeDatabase master
6767
$results | Where-Object { $PSItem.Database -eq "master" } | Should -BeNullOrEmpty
6868
}
69-
69+
7070
It "returns only check constraints from selected DB with -Database" {
7171
$results = Get-DbaDbCheckConstraint -SqlInstance $TestConfig.instance2 -Database $testDbName
7272
$results | Where-Object { $PSItem.Database -ne "master" } | Should -HaveCount 1
7373
$results.DatabaseId | Get-Unique | Should -Be (Get-DbaDatabase -SqlInstance $TestConfig.instance2 -Database $testDbName).Id
7474
}
75-
75+
7676
It "Should include test check constraint: $testCkName" {
7777
$results = Get-DbaDbCheckConstraint -SqlInstance $TestConfig.instance2 -Database $testDbName -ExcludeSystemTable
7878
$results | Where-Object Name -eq $testCkName | Select-Object -ExpandProperty Name | Should -Be $testCkName
7979
}
80-
80+
8181
It "Should exclude system tables" {
8282
$results = Get-DbaDbCheckConstraint -SqlInstance $TestConfig.instance2 -Database master -ExcludeSystemTable
8383
$results | Where-Object Name -eq "spt_fallback_db" | Should -BeNullOrEmpty
8484
}
8585
}
86-
}
86+
}

tests/Get-DbaDbCompatibility.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ Describe $CommandName -Tag IntegrationTests {
7070
$results.DatabaseId | Should -Be $masterDbId
7171
}
7272
}
73-
}
73+
}

tests/Get-DbaDbCompression.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ Describe $CommandName -Tag IntegrationTests {
9797
$excludeResults.Database | Should -Not -Contain $dbname
9898
}
9999
}
100-
}
100+
}

0 commit comments

Comments
 (0)