public virtual void ChangeDatabase() { using (HsqlConnection testSubject = new HsqlConnection("DataSource=mem:test2")) { string databaseName = "test1"; testSubject.ChangeDatabase(databaseName); testSubject.Open(); } using (HsqlConnection testSubject = new HsqlConnection("DataSource=mem:test2")) { testSubject.Open(); string databaseName = "test1"; try { testSubject.ChangeDatabase(databaseName); Assert.Fail("it is not expected that it is legal to change database while a connection is open."); } catch (Exception) { } } }