public void GetAzureSqlDatabaseWithSqlAuthByPipe() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); // Query the created test databases HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.GetAzureSqlDatabaseWithSqlAuthByPipe"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); if (expected.Index < 12) { // Request 0-3: Get all databases + ServiceObjectives requests // Request 4-11: 4 Get databases, 2 requests per get call DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); } else { Assert.Fail("No more requests expected."); } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { Collection <PSObject> databases, database1, database2; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { databases = powershell.InvokeBatchScript( @"Get-AzureSqlDatabase " + @"-Context $context"); powershell.InvokeBatchScript( @"$testdb1 = Get-AzureSqlDatabase $context -DatabaseName testdb1"); powershell.InvokeBatchScript( @"$testdb2 = Get-AzureSqlDatabase $context -DatabaseName testdb2"); database1 = powershell.InvokeBatchScript( @"$testdb1 | Get-AzureSqlDatabase"); database2 = powershell.InvokeBatchScript( @"$testdb2 | Get-AzureSqlDatabase"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); // Expecting master, testdb1, testdb2 Assert.AreEqual( 3, databases.Count, "Expecting three Database objects"); Services.Server.Database database1Obj = database1.Single().BaseObject as Services.Server.Database; Assert.IsNotNull(database1Obj, "Expecting a Database object"); DatabaseTestHelper.ValidateDatabaseProperties(database1Obj, "testdb1", "Web", 1, 1073741824L, "SQL_Latin1_General_CP1_CI_AS", "Shared", false, DatabaseTestHelper.SharedSloGuid); Services.Server.Database database2Obj = database2.Single().BaseObject as Services.Server.Database; Assert.IsNotNull(database2Obj, "Expecting a Database object"); DatabaseTestHelper.ValidateDatabaseProperties(database2Obj, "testdb2", "Web", 5, 5368709120L, "Japanese_CI_AS", "Shared", false, DatabaseTestHelper.SharedSloGuid); } } }
public void CreatePremiumDatabasesWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTest.Common.CreatePremiumDatabasesWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); switch (expected.Index) { // Request 0-6: Query P1 and P2 Service Objective case 0: case 1: case 2: case 3: case 4: case 5: case 6: // Request 7-9: Create NewAzureSqlPremiumDatabaseTests_P1 case 7: case 8: case 9: // Request 10-12: Create NewAzureSqlPremiumDatabaseTests_P2 case 10: case 11: case 12: DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); break; default: Assert.Fail("No more requests expected."); break; } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { Collection <PSObject> premiumDB_P1, PremiumDB_P2; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { powershell.InvokeBatchScript( @"$P1 = Get-AzureSqlDatabaseServiceObjective" + @" -Context $context" + @" -ServiceObjectiveName ""Reserved P1"""); powershell.InvokeBatchScript( @"$P2 = Get-AzureSqlDatabaseServiceObjective " + @"-Context $context" + @" -ServiceObjectiveName ""Reserved P2"""); premiumDB_P1 = powershell.InvokeBatchScript( @"$premiumDB_P1 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName NewAzureSqlPremiumDatabaseTests_P1 " + @"-Edition Premium " + @"-ServiceObjective $P1 "); premiumDB_P1 = powershell.InvokeBatchScript("$PremiumDB_P1"); powershell.InvokeBatchScript( @"$PremiumDB_P2 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName NewAzureSqlPremiumDatabaseTests_P2 " + @"-Collation Japanese_CI_AS " + @"-Edition Premium " + @"-ServiceObjective $P2 " + @"-MaxSizeGB 10 " + @"-Force"); PremiumDB_P2 = powershell.InvokeBatchScript("$PremiumDB_P2"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Assert.IsTrue( premiumDB_P1.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database databaseP1 = (Services.Server.Database)premiumDB_P1.Single().BaseObject; Assert.AreEqual("NewAzureSqlPremiumDatabaseTests_P1", databaseP1.Name, "Expected db name to be NewAzureSqlPremiumDatabaseTests_P1"); Assert.IsTrue( PremiumDB_P2.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database databaseP2 = (Services.Server.Database)PremiumDB_P2.Single().BaseObject; Assert.AreEqual("NewAzureSqlPremiumDatabaseTests_P2", databaseP2.Name, "Expected db name to be NewAzureSqlPremiumDatabaseTests_P2"); Assert.AreEqual( "Japanese_CI_AS", databaseP2.CollationName, "Expected collation to be Japanese_CI_AS"); /* SQL Server: Defect 1655888: When creating a premium database, * the immediate returned value do not have valid Edition and Max Database Size info * We should active the following asserts once the defect is fixed. * Assert.AreEqual("Premium", database2Obj.Edition, "Expected edition to be Premium"); * Assert.AreEqual(10, database2Obj.MaxSizeGB, "Expected max size to be 10 GB"); */ } } }
public void SetAzureSqlDatabaseServiceObjectiveWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.SetAzureSqlDatabaseServiceObjectiveWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); switch (expected.Index) { // Request 0-1: Get Service Objective case 0: case 1: // Request 2-7: Get/Update/Re-Get testdb2 case 2: case 3: case 4: case 5: case 6: DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); break; default: Assert.Fail("No more requests expected."); break; } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Create context with both ManageUrl and ServerName overriden Collection <PSObject> database; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { powershell.InvokeBatchScript( @"$slo = Get-AzureSqlDatabaseServiceObjective " + @"-Context $context " + @"-ServiceObjectiveName ""P1"""); database = powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb2 " + @"-ServiceObjective $slo " + @"-Force " + @"-PassThru"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Services.Server.Database databaseObj = database.Single().BaseObject as Services.Server.Database; Assert.IsNotNull(databaseObj, "Expecting a Database object"); Assert.AreEqual("testdb2", databaseObj.Name, "Expected db name to be testdb2"); Assert.AreEqual((byte)0, databaseObj.ServiceObjectiveAssignmentState, "Expected assignment state to be complete"); DatabaseTestHelper.ValidateDatabaseProperties(databaseObj, "testdb2", "Web", 5, 5368709120L, "Japanese_CI_AS", "Shared", false, DatabaseTestHelper.PremiumP1SloGuid); } } }
public void SetAzureSqlPremiumDatabaseServiceObjectiveWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.SetAzureSqlPremiumDatabaseServiceObjectiveWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Create context with both ManageUrl and ServerName overriden Collection <PSObject> premiumDB; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { powershell.InvokeBatchScript( @"$P1 = Get-AzureSqlDatabaseServiceObjective" + @" -Context $context" + @" -ServiceObjectiveName ""P1"""); powershell.InvokeBatchScript( @"$premiumDB_P1 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Edition Premium " + @"-ServiceObjective $P1 "); premiumDB = powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Edition Business " + @"-Force " + @"-PassThru"); powershell.InvokeBatchScript( @"Remove-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Force "); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Services.Server.Database premiumDBObj = premiumDB.Single().BaseObject as Services.Server.Database; Assert.IsNotNull(premiumDBObj, "Expecting a Database object"); DatabaseTestHelper.ValidateDatabaseProperties(premiumDBObj, "SetAzureSqlPremiumDatabaseTests_P1", "Premium", 10, 10737418240L, "SQL_Latin1_General_CP1_CI_AS", "P1", false, DatabaseTestHelper.PremiumP1SloGuid); } } }
public void SetAzureSqlDatabaseNameWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$contextCleanup"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.SetAzureSqlDatabaseNameWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); if (expected.Index < 10) { // Request 0-4: Set testdb1 with new name of new_testdb1 // Request 5-9: Set new_testdb1 with new name of testdb1 DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); } else { Assert.Fail("No more requests expected."); } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Create context with both ManageUrl and ServerName overriden Collection <PSObject> database; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { database = powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb1 " + @"-NewName new_testdb1 " + @"-Force " + @"-PassThru"); powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $contextCleanup " + @"-DatabaseName new_testdb1 " + @"-NewName testdb1 " + @"-Force"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Services.Server.Database databaseObj = database.Single().BaseObject as Services.Server.Database; Assert.IsNotNull(databaseObj, "Expecting a Database object"); DatabaseTestHelper.ValidateDatabaseProperties(databaseObj, "new_testdb1", "Web", 1, 1073741824L, "SQL_Latin1_General_CP1_CI_AS", "Shared", false, DatabaseTestHelper.SharedSloGuid); } } }
public void SetAzureSqlDatabaseSizeWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.SetAzureSqlDatabaseSizeWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); if (expected.Index < 5) { // Request 0-2: Set testdb1 with new MaxSize // Request 3-4: Get updated testdb1 DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); } else { Assert.Fail("No more requests expected."); } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Create context with both ManageUrl and ServerName overriden Collection <PSObject> database; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { database = powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb1 " + @"-MaxSizeGB 5 " + @"-Force " + @"-PassThru"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Assert.IsTrue( database.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database databaseObj = (Services.Server.Database)database.Single().BaseObject; Assert.AreEqual("testdb1", databaseObj.Name, "Expected db name to be testdb1"); Assert.AreEqual("Web", databaseObj.Edition, "Expected edition to be Web"); Assert.AreEqual(5, databaseObj.MaxSizeGB, "Expected max size to be 5 GB"); } } }
public void SetAzureSqlPremiumDatabaseServiceObjectiveWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.SetAzureSqlPremiumDatabaseServiceObjectiveWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Create context with both ManageUrl and ServerName overriden Collection <PSObject> database, premiumDB; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { powershell.InvokeBatchScript( @"$P1 = Get-AzureSqlDatabaseServiceObjective" + @" -Context $context" + @" -ServiceObjectiveName ""Reserved P1"""); powershell.InvokeBatchScript( @"$premiumDB_P1 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Edition Premium " + @"-ServiceObjective $P1 "); premiumDB = powershell.InvokeBatchScript( @"Set-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Edition Business " + @"-Force " + @"-PassThru"); powershell.InvokeBatchScript( @"Remove-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName SetAzureSqlPremiumDatabaseTests_P1 " + @"-Force "); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Assert.IsTrue( premiumDB.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database premiumDBObj = (Services.Server.Database)premiumDB.Single().BaseObject; Assert.AreEqual("SetAzureSqlPremiumDatabaseTests_P1", premiumDBObj.Name, "Expected db name to be SetAzureSqlPremiumDatabaseTests_P1"); Assert.AreEqual("Business", premiumDBObj.Edition, "Expected db edition to be Business"); Assert.AreEqual("Shared", premiumDBObj.ServiceObjective.Name, "Expected db ServiceObjective to be Shared"); } } }
public void GetAzureSqlDatabaseWithSqlAuth() { using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create()) { // Create a context NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth( powershell, "$context"); // Query the created test databases HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTests.GetAzureSqlDatabaseWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); switch (expected.Index) { // Request 0-3: Get all databases + ServiceObjective lookup for each database case 0: case 1: case 2: case 3: // Request 4-7: Get database requests, 2 requests per get case 4: case 5: case 6: case 7: DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); break; default: Assert.Fail("No more requests expected."); break; } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { // Retrieve all databases then each individual ones Collection <PSObject> databases, database1, database2; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { databases = powershell.InvokeBatchScript( @"Get-AzureSqlDatabase " + @"-Context $context"); database1 = powershell.InvokeBatchScript( @"Get-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb1"); database2 = powershell.InvokeBatchScript( @"Get-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb2"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); // Expecting master, testdb1, testdb2 Assert.AreEqual( 3, databases.Count, "Expecting three Database objects"); Assert.IsTrue( database1.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database database1Obj = (Services.Server.Database)database1.Single().BaseObject; Assert.AreEqual( "testdb1", database1Obj.Name, "Expected db name to be testdb1"); Assert.IsTrue( database2.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database database2Obj = (Services.Server.Database)database2.Single().BaseObject; Assert.AreEqual( "testdb2", database2Obj.Name, "Expected db name to be testdb2"); Assert.AreEqual( "Japanese_CI_AS", database2Obj.CollationName, "Expected collation to be Japanese_CI_AS"); Assert.AreEqual("Web", database2Obj.Edition, "Expected edition to be Web"); Assert.AreEqual(5, database2Obj.MaxSizeGB, "Expected max size to be 5 GB"); } } }
/// <summary> /// Create $testdb1 and $testdb2 on the given context. /// </summary> /// <param name="powershell">The powershell instance containing the context.</param> /// <param name="contextVariable">The variable name that holds the server context.</param> public static void CreateTestDatabasesWithSqlAuth( System.Management.Automation.PowerShell powershell, string contextVariable) { HttpSession testSession = MockServerHelper.DefaultSessionCollection.GetSession( "UnitTest.Common.CreateTestDatabasesWithSqlAuth"); DatabaseTestHelper.SetDefaultTestSessionSettings(testSession); testSession.RequestValidator = new Action <HttpMessage, HttpMessage.Request>( (expected, actual) => { Assert.AreEqual(expected.RequestInfo.Method, actual.Method); Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent); switch (expected.Index) { // Request 0-2: Create testdb1 // Request 3-5: Create testdb2 case 0: case 1: case 2: case 3: case 4: case 5: DatabaseTestHelper.ValidateHeadersForODataRequest( expected.RequestInfo, actual); break; default: Assert.Fail("No more requests expected."); break; } }); using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager()) { Collection <PSObject> database1, database2; using (new MockHttpServer( exceptionManager, MockHttpServer.DefaultServerPrefixUri, testSession)) { database1 = powershell.InvokeBatchScript( @"$testdb1 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb1 " + @"-Force", @"$testdb1"); database2 = powershell.InvokeBatchScript( @"$testdb2 = New-AzureSqlDatabase " + @"-Context $context " + @"-DatabaseName testdb2 " + @"-Collation Japanese_CI_AS " + @"-Edition Web " + @"-MaxSizeGB 5 " + @"-Force", @"$testdb2"); } Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!"); Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!"); powershell.Streams.ClearStreams(); Assert.IsTrue( database1.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database database1Obj = (Services.Server.Database)database1.Single().BaseObject; Assert.AreEqual("testdb1", database1Obj.Name, "Expected db name to be testdb1"); Assert.IsTrue( database2.Single().BaseObject is Services.Server.Database, "Expecting a Database object"); Services.Server.Database database2Obj = (Services.Server.Database)database2.Single().BaseObject; Assert.AreEqual("testdb2", database2Obj.Name, "Expected db name to be testdb2"); Assert.AreEqual( "Japanese_CI_AS", database2Obj.CollationName, "Expected collation to be Japanese_CI_AS"); Assert.AreEqual("Web", database2Obj.Edition, "Expected edition to be Web"); Assert.AreEqual(5, database2Obj.MaxSizeGB, "Expected max size to be 5 GB"); } }