Skip to content

Commit d4eaaf4

Browse files
author
John Paul Kee
committed
Fixing tabs
1 parent 39b89f2 commit d4eaaf4

File tree

3 files changed

+375
-375
lines changed

3 files changed

+375
-375
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseCrudTests.ps1

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
3939
$job1 | Wait-Job
4040
$db = $job1.Output
4141

42-
Assert-AreEqual $databaseName $db.DatabaseName
42+
Assert-AreEqual $databaseName $db.DatabaseName
4343
Assert-NotNull $db.MaxSizeBytes
4444
Assert-NotNull $db.Edition
4545
Assert-NotNull $db.CurrentServiceObjectiveName
@@ -68,7 +68,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
6868
Assert-AreEqual $dwdb.Edition DataWarehouse
6969
Assert-AreEqual $dwdb.CurrentServiceObjectiveName DW100
7070
Assert-AreEqual $dwdb.CollationName $collationName
71-
71+
7272
# Create with all parameters
7373
$databaseName = Get-DatabaseName
7474
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
@@ -107,7 +107,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
107107
#>
108108
function Test-CreateVcoreDatabase
109109
{
110-
# Setup
110+
# Setup
111111
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
112112
$rg = Create-ResourceGroupForTest $location
113113
$server = Create-ServerForTest $rg $location
@@ -120,7 +120,7 @@ function Test-CreateVcoreDatabase
120120
$job1 | Wait-Job
121121
$db = $job1.Output
122122

123-
Assert-AreEqual $databaseName $db.DatabaseName
123+
Assert-AreEqual $databaseName $db.DatabaseName
124124
Assert-NotNull $db.MaxSizeBytes
125125
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
126126
Assert-AreEqual 2 $db.Capacity
@@ -132,7 +132,7 @@ function Test-CreateVcoreDatabase
132132
$job1 | Wait-Job
133133
$db = $job1.Output
134134

135-
Assert-AreEqual $databaseName $db.DatabaseName
135+
Assert-AreEqual $databaseName $db.DatabaseName
136136
Assert-NotNull $db.MaxSizeBytes
137137
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
138138
Assert-AreEqual 2 $db.Capacity
@@ -157,25 +157,25 @@ function Test-CreateVcoreDatabaseWithLicenseType
157157

158158
try
159159
{
160-
# Create with Edition and RequestedServiceObjectiveName - Base Price
160+
# Create with Edition and RequestedServiceObjectiveName - Base Price
161161
$databaseName = Get-DatabaseName
162162
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose -LicenseType BasePrice
163-
Assert-AreEqual BasePrice $db.LicenseType
163+
Assert-AreEqual BasePrice $db.LicenseType
164164

165-
# Create with Edition and RequestedServiceObjectiveName - LicenseIncluded
165+
# Create with Edition and RequestedServiceObjectiveName - LicenseIncluded
166166
$databaseName = Get-DatabaseName
167167
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose -LicenseType LicenseIncluded
168-
Assert-AreEqual LicenseIncluded $db.LicenseType
168+
Assert-AreEqual LicenseIncluded $db.LicenseType
169169

170170
# Create with VCore parameter set - BasePrice
171171
$databaseName = Get-DatabaseName
172172
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -VCore 2 -ComputeGeneration Gen4 -Edition GeneralPurpose -LicenseType BasePrice
173-
Assert-AreEqual BasePrice $db.LicenseType
173+
Assert-AreEqual BasePrice $db.LicenseType
174174

175-
# Create with VCore parameter set - LicenseIncluded
175+
# Create with VCore parameter set - LicenseIncluded
176176
$databaseName = Get-DatabaseName
177177
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -VCore 2 -ComputeGeneration Gen4 -Edition GeneralPurpose -LicenseType LicenseIncluded
178-
Assert-AreEqual LicenseIncluded $db.LicenseType
178+
Assert-AreEqual LicenseIncluded $db.LicenseType
179179
}
180180
finally
181181
{
@@ -284,13 +284,13 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
284284
# Setup
285285
$rg = Create-ResourceGroupForTest
286286
$server = Create-ServerForTest $rg $location
287-
287+
288288
$databaseName = Get-DatabaseName
289289
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
290290
-Edition Standard -MaxSizeBytes 250GB -RequestedServiceObjectiveName S0
291291
Assert-AreEqual $db.DatabaseName $databaseName
292292

293-
# Database will be Standard s0 with maxsize: 268435456000 (250GB)
293+
# Database will be Standard s0 with maxsize: 268435456000 (250GB)
294294

295295
try
296296
{
@@ -346,11 +346,11 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
346346

347347
<#
348348
.SYNOPSIS
349-
Tests updating a vcore database
349+
Tests updating a vcore database
350350
#>
351351
function Test-UpdateVcoreDatabase()
352352
{
353-
# Setup
353+
# Setup
354354
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
355355
$rg = Create-ResourceGroupForTest $location
356356
$server = Create-ServerForTest $rg $location
@@ -430,34 +430,34 @@ function Test-UpdateVcoreDatabase()
430430
#>
431431
function Test-UpdateVcoreDatabaseLicenseType()
432432
{
433-
# Setup
433+
# Setup
434434
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
435435
$rg = Create-ResourceGroupForTest $location
436436
$server = Create-ServerForTest $rg $location
437437

438-
# Create vcore database
438+
# Create vcore database
439439
$databaseName = Get-DatabaseName
440440
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -RequestedServiceObjectiveName GP_Gen4_1 -Edition GeneralPurpose
441441
Assert-AreEqual $db.DatabaseName $databaseName
442-
Assert-AreEqual $db.LicenseType LicenseIncluded # Default license type
442+
Assert-AreEqual $db.LicenseType LicenseIncluded # Default license type
443443

444444
try
445445
{
446446
# Alter with license type - License Included
447447
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -LicenseType LicenseIncluded
448-
Assert-AreEqual LicenseIncluded $db1.LicenseType
448+
Assert-AreEqual LicenseIncluded $db1.LicenseType
449449

450-
# Alter with license type - Base Price
450+
# Alter with license type - Base Price
451451
$db1 = Set-AzureRmSqlDatabase -ResourceGroupName $db.ResourceGroupName -ServerName $db.ServerName -DatabaseName $db.DatabaseName -LicenseType BasePrice
452-
Assert-AreEqual BasePrice $db1.LicenseType
452+
Assert-AreEqual BasePrice $db1.LicenseType
453453

454-
# Test piping - LicenseIncluded
455-
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType LicenseIncluded
456-
Assert-AreEqual LicenseIncluded $db1.LicenseType
454+
# Test piping - LicenseIncluded
455+
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType LicenseIncluded
456+
Assert-AreEqual LicenseIncluded $db1.LicenseType
457457

458-
# Test piping - BasePrice
459-
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType BasePrice
460-
Assert-AreEqual BasePrice $db1.LicenseType
458+
# Test piping - BasePrice
459+
$db1 = $db1 | Set-AzureRmSqlDatabase -LicenseType BasePrice
460+
Assert-AreEqual BasePrice $db1.LicenseType
461461
}
462462
finally
463463
{
@@ -475,7 +475,7 @@ function Test-UpdateDatabaseWithZoneRedundant ()
475475
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
476476
$rg = Create-ResourceGroupForTest $location
477477
$server = Create-ServerForTest $rg $location
478-
478+
479479
$databaseName = Get-DatabaseName
480480
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
481481
-Edition Premium
@@ -522,7 +522,7 @@ function Test-UpdateDatabaseWithZoneRedundantNotSpecified ()
522522
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
523523
$rg = Create-ResourceGroupForTest $location
524524
$server = Create-ServerForTest $rg $location
525-
525+
526526
$databaseName = Get-DatabaseName
527527
$db = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
528528
-Edition Premium -ZoneRedundant
@@ -560,7 +560,7 @@ function Test-RenameDatabase
560560
{
561561
$location = "westcentralus"
562562
$server = Create-ServerForTest $rg $location
563-
563+
564564
# Create with default values
565565
$databaseName = Get-DatabaseName
566566
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
@@ -608,17 +608,17 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
608608
# Setup
609609
$rg = Create-ResourceGroupForTest
610610
$server = Create-ServerForTest $rg $location
611-
611+
612612
# Create with default values
613613
$databaseName = Get-DatabaseName
614614
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
615615
Assert-AreEqual $db1.DatabaseName $databaseName
616616

617-
# Create database with non-defaults
617+
# Create database with non-defaults
618618
$databaseName = Get-DatabaseName
619619
$db2 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
620620
-CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic
621-
Assert-AreEqual $db2.DatabaseName $databaseName
621+
Assert-AreEqual $db2.DatabaseName $databaseName
622622

623623
try
624624
{
@@ -636,21 +636,21 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
636636
$all = $server | Get-AzureRmSqlDatabase
637637
Assert-AreEqual $all.Count 4 # 4 because master database is included
638638

639-
$gdb1 = Get-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName
640-
Assert-NotNull $gdb1
641-
Assert-AreEqual $db1.DatabaseName $gdb1.DatabaseName
642-
Assert-AreEqual $db1.Edition $gdb1.Edition
643-
Assert-AreEqual $db1.CollationName $gdb1.CollationName
644-
Assert-AreEqual $db1.CurrentServiceObjectiveName $gdb1.CurrentServiceObjectiveName
645-
Assert-AreEqual $db1.MaxSizeBytes $gdb1.MaxSizeBytes
646-
647-
$gdb2 = $db2 | Get-AzureRmSqlDatabase
648-
Assert-NotNull $gdb2
649-
Assert-AreEqual $db2.DatabaseName $gdb2.DatabaseName
650-
Assert-AreEqual $db2.Edition $gdb2.Edition
651-
Assert-AreEqual $db2.CollationName $gdb2.CollationName
652-
Assert-AreEqual $db2.CurrentServiceObjectiveName $gdb2.CurrentServiceObjectiveName
653-
Assert-AreEqual $db2.MaxSizeBytes $gdb2.MaxSizeBytes
639+
$gdb1 = Get-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName
640+
Assert-NotNull $gdb1
641+
Assert-AreEqual $db1.DatabaseName $gdb1.DatabaseName
642+
Assert-AreEqual $db1.Edition $gdb1.Edition
643+
Assert-AreEqual $db1.CollationName $gdb1.CollationName
644+
Assert-AreEqual $db1.CurrentServiceObjectiveName $gdb1.CurrentServiceObjectiveName
645+
Assert-AreEqual $db1.MaxSizeBytes $gdb1.MaxSizeBytes
646+
647+
$gdb2 = $db2 | Get-AzureRmSqlDatabase
648+
Assert-NotNull $gdb2
649+
Assert-AreEqual $db2.DatabaseName $gdb2.DatabaseName
650+
Assert-AreEqual $db2.Edition $gdb2.Edition
651+
Assert-AreEqual $db2.CollationName $gdb2.CollationName
652+
Assert-AreEqual $db2.CurrentServiceObjectiveName $gdb2.CurrentServiceObjectiveName
653+
Assert-AreEqual $db2.MaxSizeBytes $gdb2.MaxSizeBytes
654654
}
655655
finally
656656
{
@@ -714,17 +714,17 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
714714
# Setup
715715
$rg = Create-ResourceGroupForTest
716716
$server = Create-ServerForTest $rg $location
717-
717+
718718
# Create with default values
719719
$databaseName = Get-DatabaseName
720720
$db1 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName -MaxSizeBytes 1GB
721721
Assert-AreEqual $db1.DatabaseName $databaseName
722722

723-
# Create database with non-defaults
723+
# Create database with non-defaults
724724
$databaseName = Get-DatabaseName
725725
$db2 = New-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
726726
-CollationName "Japanese_Bushu_Kakusu_100_CS_AS" -MaxSizeBytes 1GB -Edition Basic -RequestedServiceObjectiveName Basic
727-
Assert-AreEqual $db2.DatabaseName $databaseName
727+
Assert-AreEqual $db2.DatabaseName $databaseName
728728

729729
try
730730
{
@@ -735,16 +735,16 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
735735
Assert-AreEqual $dwdb.DatabaseName $databaseName
736736

737737
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $dwdb.DatabaseName -Force
738-
738+
739739
$all = $server | Get-AzureRmSqlDatabase
740740
Assert-AreEqual $all.Count 3 # 3 because master database is included
741-
742-
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName -Force
743741

744-
$db2 | Remove-AzureRmSqlDatabase -Force
742+
Remove-AzureRmSqlDatabase -ResourceGroupName $server.ResourceGroupname -ServerName $server.ServerName -DatabaseName $db1.DatabaseName -Force
745743

746-
$all = $server | Get-AzureRmSqlDatabase
747-
Assert-AreEqual $all.Count 1 # 1 because master database is included
744+
$db2 | Remove-AzureRmSqlDatabase -Force
745+
746+
$all = $server | Get-AzureRmSqlDatabase
747+
Assert-AreEqual $all.Count 1 # 1 because master database is included
748748
}
749749
finally
750750
{

0 commit comments

Comments
 (0)