Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 20 vs 21 for /trunk/ConnectionServerOdbcIntegrationTests/IntegrationTests/ConnectionServerOdbcIntegrationTests.cs

Diff revisions: vs.
  @@ -23,7 +23,7 @@
23 23 public new static void MyClassInitialize(TestContext testContext)
24 24 {
25 25 BaseIntegrationTests.MyClassInitialize(testContext);
26 - Server.DatabaseInterface.ErrorEvents += ServerOnErrorEvents;
26 + Server.ErrorEvents += ServerOnErrorEvents;
27 27 }
28 28
29 29 private static void ServerOnErrorEvents(object sender, LogEventArgs logEventArgs)
  @@ -53,7 +53,7 @@
53 53 public void IntegerPropertyTests()
54 54 {
55 55 Console.WriteLine("Neighbor count=" + Server.NeighborLocations.Count);
56 - Assert.IsTrue(Server.DatabaseConnectionStatus == ConnectionStatus.Connected, "DatabaseConnectionStatus value false");
56 + Assert.IsTrue(Server.ServerConnectionStatus == ConnectionStatus.Connected, "DatabaseConnectionStatus value false");
57 57 Assert.IsTrue(Server.UnityVersionMajor >0, "Version Major is not greater than 0:"+Server.UnityVersionMajor);
58 58 Console.WriteLine(Server.UnityVersionRev);
59 59 Console.WriteLine(Server.UnityVersionMinor);
  @@ -127,15 +127,39 @@
127 127 [TestMethod]
128 128 public void LoginLogoutTest()
129 129 {
130 - UnityConnectionServerOdbc oServer = new UnityConnectionServerOdbc(new UnityConnectionDatabaseFunctions("Test"));
130 + UnityConnectionServerOdbcSdk oServer = new UnityConnectionServerOdbcSdk("Test");
131 131 var res=oServer.LoginDatabaseBlocking(Server.DatabaseServerName,Server.DatabaseLoginName, Server.DatabaseLoginPassword);
132 132 Assert.IsTrue(res.Successful,"Failed to log in to second instance of server:"+res);
133 133
134 134 oServer.LogoutBlocking();
135 135 }
136 136
137 + [TestMethod]
138 + public void Login_InvalidServerName_Failure()
139 + {
140 + UnityConnectionServerOdbcSdk oServer = new UnityConnectionServerOdbcSdk("Test");
141 + var res = oServer.LoginDatabaseBlocking("junk", Server.DatabaseLoginName, Server.DatabaseLoginPassword);
142 + Assert.IsFalse(res.Successful, "Invalid server name should return login failure");
143 + }
137 144
138 145 [TestMethod]
146 + public void Login_InvalidLoginName_Failure()
147 + {
148 + UnityConnectionServerOdbcSdk oServer = new UnityConnectionServerOdbcSdk("Test");
149 + var res = oServer.LoginDatabaseBlocking(Server.DatabaseServerName, "invalid", Server.DatabaseLoginPassword);
150 + Assert.IsFalse(res.Successful, "Invalid login name should return login failure");
151 + }
152 +
153 + [TestMethod]
154 + public void Login_InvalidPassword_Failure()
155 + {
156 + UnityConnectionServerOdbcSdk oServer = new UnityConnectionServerOdbcSdk("Test");
157 + var res = oServer.LoginDatabaseBlocking(Server.DatabaseServerName, Server.DatabaseLoginName, "invalid");
158 + Assert.IsFalse(res.Successful, "Invalid login name should return login failure");
159 + }
160 +
161 +
162 + [TestMethod]
139 163 public void UpdateStatisticsTest_Success()
140 164 {
141 165 var res = Server.UpdateStatisticsForMailstore("UnityDynDb");
  @@ -163,16 +187,22 @@
163 187 Assert.IsFalse(ret,"false should be returned if language code cannot be parsed as an int");
164 188 }
165 189
166 -
167 -
168 190 [TestMethod]
169 191 public void FillDataTableBlocking_InvalidQuery()
170 192 {
171 193 DataTable oTable;
172 - var res = Server.DatabaseInterface.FillDataTableBlocking("invalid query string", out oTable);
194 + var res = Server.FillDataTableBlocking("invalid query string", out oTable);
173 195 Assert.IsFalse(res.Successful, "FillDataTableBlocking call should fail with invalid query");
174 196 }
175 197
198 + [TestMethod]
199 + public void GreetingsAdministrator_Success()
200 + {
201 + Assert.IsFalse(string.IsNullOrEmpty(Server.GreetingsAdministratorRoleObjectId),
202 + "GreetingsAdministratorRoleObjectId is blank");
203 + }
204 +
205 +
176 206
177 207 }
178 208 }