@@ -39,7 +39,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
39
39
$job1 | Wait-Job
40
40
$db = $job1.Output
41
41
42
- Assert-AreEqual $databaseName $db.DatabaseName
42
+ Assert-AreEqual $databaseName $db.DatabaseName
43
43
Assert-NotNull $db.MaxSizeBytes
44
44
Assert-NotNull $db.Edition
45
45
Assert-NotNull $db.CurrentServiceObjectiveName
@@ -68,7 +68,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
68
68
Assert-AreEqual $dwdb.Edition DataWarehouse
69
69
Assert-AreEqual $dwdb.CurrentServiceObjectiveName DW100
70
70
Assert-AreEqual $dwdb.CollationName $collationName
71
-
71
+
72
72
# Create with all parameters
73
73
$databaseName = Get-DatabaseName
74
74
$db = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
@@ -107,7 +107,7 @@ function Test-CreateDatabaseInternal ($location = "westcentralus")
107
107
#>
108
108
function Test-CreateVcoreDatabase
109
109
{
110
- # Setup
110
+ # Setup
111
111
$location = Get-Location " Microsoft.Sql" " operations" " Southeast Asia"
112
112
$rg = Create- ResourceGroupForTest $location
113
113
$server = Create- ServerForTest $rg $location
@@ -120,7 +120,7 @@ function Test-CreateVcoreDatabase
120
120
$job1 | Wait-Job
121
121
$db = $job1.Output
122
122
123
- Assert-AreEqual $databaseName $db.DatabaseName
123
+ Assert-AreEqual $databaseName $db.DatabaseName
124
124
Assert-NotNull $db.MaxSizeBytes
125
125
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
126
126
Assert-AreEqual 2 $db.Capacity
@@ -132,7 +132,7 @@ function Test-CreateVcoreDatabase
132
132
$job1 | Wait-Job
133
133
$db = $job1.Output
134
134
135
- Assert-AreEqual $databaseName $db.DatabaseName
135
+ Assert-AreEqual $databaseName $db.DatabaseName
136
136
Assert-NotNull $db.MaxSizeBytes
137
137
Assert-AreEqual GP_Gen4_2 $db.CurrentServiceObjectiveName
138
138
Assert-AreEqual 2 $db.Capacity
@@ -157,25 +157,25 @@ function Test-CreateVcoreDatabaseWithLicenseType
157
157
158
158
try
159
159
{
160
- # Create with Edition and RequestedServiceObjectiveName - Base Price
160
+ # Create with Edition and RequestedServiceObjectiveName - Base Price
161
161
$databaseName = Get-DatabaseName
162
162
$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
164
164
165
- # Create with Edition and RequestedServiceObjectiveName - LicenseIncluded
165
+ # Create with Edition and RequestedServiceObjectiveName - LicenseIncluded
166
166
$databaseName = Get-DatabaseName
167
167
$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
169
169
170
170
# Create with VCore parameter set - BasePrice
171
171
$databaseName = Get-DatabaseName
172
172
$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
174
174
175
- # Create with VCore parameter set - LicenseIncluded
175
+ # Create with VCore parameter set - LicenseIncluded
176
176
$databaseName = Get-DatabaseName
177
177
$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
179
179
}
180
180
finally
181
181
{
@@ -284,13 +284,13 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
284
284
# Setup
285
285
$rg = Create- ResourceGroupForTest
286
286
$server = Create- ServerForTest $rg $location
287
-
287
+
288
288
$databaseName = Get-DatabaseName
289
289
$db = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
290
290
- Edition Standard - MaxSizeBytes 250 GB - RequestedServiceObjectiveName S0
291
291
Assert-AreEqual $db.DatabaseName $databaseName
292
292
293
- # Database will be Standard s0 with maxsize: 268435456000 (250GB)
293
+ # Database will be Standard s0 with maxsize: 268435456000 (250GB)
294
294
295
295
try
296
296
{
@@ -346,11 +346,11 @@ function Test-UpdateDatabaseInternal ($location = "westcentralus")
346
346
347
347
<#
348
348
. SYNOPSIS
349
- Tests updating a vcore database
349
+ Tests updating a vcore database
350
350
#>
351
351
function Test-UpdateVcoreDatabase ()
352
352
{
353
- # Setup
353
+ # Setup
354
354
$location = Get-Location " Microsoft.Sql" " operations" " Southeast Asia"
355
355
$rg = Create- ResourceGroupForTest $location
356
356
$server = Create- ServerForTest $rg $location
@@ -430,34 +430,34 @@ function Test-UpdateVcoreDatabase()
430
430
#>
431
431
function Test-UpdateVcoreDatabaseLicenseType ()
432
432
{
433
- # Setup
433
+ # Setup
434
434
$location = Get-Location " Microsoft.Sql" " operations" " Southeast Asia"
435
435
$rg = Create- ResourceGroupForTest $location
436
436
$server = Create- ServerForTest $rg $location
437
437
438
- # Create vcore database
438
+ # Create vcore database
439
439
$databaseName = Get-DatabaseName
440
440
$db = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName - RequestedServiceObjectiveName GP_Gen4_1 - Edition GeneralPurpose
441
441
Assert-AreEqual $db.DatabaseName $databaseName
442
- Assert-AreEqual $db.LicenseType LicenseIncluded # Default license type
442
+ Assert-AreEqual $db.LicenseType LicenseIncluded # Default license type
443
443
444
444
try
445
445
{
446
446
# Alter with license type - License Included
447
447
$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
449
449
450
- # Alter with license type - Base Price
450
+ # Alter with license type - Base Price
451
451
$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
453
453
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
457
457
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
461
461
}
462
462
finally
463
463
{
@@ -475,7 +475,7 @@ function Test-UpdateDatabaseWithZoneRedundant ()
475
475
$location = Get-Location " Microsoft.Sql" " operations" " Southeast Asia"
476
476
$rg = Create- ResourceGroupForTest $location
477
477
$server = Create- ServerForTest $rg $location
478
-
478
+
479
479
$databaseName = Get-DatabaseName
480
480
$db1 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
481
481
- Edition Premium
@@ -522,7 +522,7 @@ function Test-UpdateDatabaseWithZoneRedundantNotSpecified ()
522
522
$location = Get-Location " Microsoft.Sql" " operations" " Southeast Asia"
523
523
$rg = Create- ResourceGroupForTest $location
524
524
$server = Create- ServerForTest $rg $location
525
-
525
+
526
526
$databaseName = Get-DatabaseName
527
527
$db = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
528
528
- Edition Premium - ZoneRedundant
@@ -560,7 +560,7 @@ function Test-RenameDatabase
560
560
{
561
561
$location = " westcentralus"
562
562
$server = Create- ServerForTest $rg $location
563
-
563
+
564
564
# Create with default values
565
565
$databaseName = Get-DatabaseName
566
566
$db1 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName - MaxSizeBytes 1 GB
@@ -608,17 +608,17 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
608
608
# Setup
609
609
$rg = Create- ResourceGroupForTest
610
610
$server = Create- ServerForTest $rg $location
611
-
611
+
612
612
# Create with default values
613
613
$databaseName = Get-DatabaseName
614
614
$db1 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName - MaxSizeBytes 1 GB
615
615
Assert-AreEqual $db1.DatabaseName $databaseName
616
616
617
- # Create database with non-defaults
617
+ # Create database with non-defaults
618
618
$databaseName = Get-DatabaseName
619
619
$db2 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
620
620
- CollationName " Japanese_Bushu_Kakusu_100_CS_AS" - MaxSizeBytes 1 GB - Edition Basic - RequestedServiceObjectiveName Basic
621
- Assert-AreEqual $db2.DatabaseName $databaseName
621
+ Assert-AreEqual $db2.DatabaseName $databaseName
622
622
623
623
try
624
624
{
@@ -636,21 +636,21 @@ function Test-GetDatabaseInternal ($location = "westcentralus")
636
636
$all = $server | Get-AzureRmSqlDatabase
637
637
Assert-AreEqual $all.Count 4 # 4 because master database is included
638
638
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
654
654
}
655
655
finally
656
656
{
@@ -714,17 +714,17 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
714
714
# Setup
715
715
$rg = Create- ResourceGroupForTest
716
716
$server = Create- ServerForTest $rg $location
717
-
717
+
718
718
# Create with default values
719
719
$databaseName = Get-DatabaseName
720
720
$db1 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName - MaxSizeBytes 1 GB
721
721
Assert-AreEqual $db1.DatabaseName $databaseName
722
722
723
- # Create database with non-defaults
723
+ # Create database with non-defaults
724
724
$databaseName = Get-DatabaseName
725
725
$db2 = New-AzureRmSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
726
726
- CollationName " Japanese_Bushu_Kakusu_100_CS_AS" - MaxSizeBytes 1 GB - Edition Basic - RequestedServiceObjectiveName Basic
727
- Assert-AreEqual $db2.DatabaseName $databaseName
727
+ Assert-AreEqual $db2.DatabaseName $databaseName
728
728
729
729
try
730
730
{
@@ -735,16 +735,16 @@ function Test-RemoveDatabaseInternal ($location = "westcentralus")
735
735
Assert-AreEqual $dwdb.DatabaseName $databaseName
736
736
737
737
Remove-AzureRmSqlDatabase - ResourceGroupName $server.ResourceGroupname - ServerName $server.ServerName - DatabaseName $dwdb.DatabaseName - Force
738
-
738
+
739
739
$all = $server | Get-AzureRmSqlDatabase
740
740
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
743
741
744
- $db2 | Remove-AzureRmSqlDatabase - Force
742
+ Remove-AzureRmSqlDatabase - ResourceGroupName $server .ResourceGroupname - ServerName $server .ServerName - DatabaseName $db1 .DatabaseName - Force
745
743
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
748
748
}
749
749
finally
750
750
{
0 commit comments