Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 15 vs 19 for /trunk/ConnectionServerOdbcIntegrationTests/IntegrationTests/ConnectionServerOdbcIntegrationTests.cs

Diff revisions: vs.
  @@ -1,13 +1,21 @@
1 1 using System;
2 + using System.Data;
2 3 using Microsoft.VisualStudio.TestTools.UnitTesting;
3 4 using Cisco.UnityConnection.OdbcSdk;
4 5
5 - namespace ConnectionServerOdbcIntegrationTests
6 + namespace UnityConnectionServerOdbcTests
6 7 {
7 8 [TestClass]
8 - public class IntegrationTest : BaseIntegrationTests
9 + public class UnityConnectionServerOdbcIntegrationTest : BaseIntegrationTests
9 10 {
10 11
12 + #region Fields and Properties
13 +
14 + private static bool _errorRaised;
15 +
16 + #endregion
17 +
18 +
11 19 #region Additional test attributes
12 20
13 21 //Use ClassInitialize to run code before running the first test in the class
  @@ -15,6 +23,12 @@
15 23 public new static void MyClassInitialize(TestContext testContext)
16 24 {
17 25 BaseIntegrationTests.MyClassInitialize(testContext);
26 + Server.DatabaseFunctions.ErrorEvents += ServerOnErrorEvents;
27 + }
28 +
29 + private static void ServerOnErrorEvents(object sender, LogEventArgs logEventArgs)
30 + {
31 + _errorRaised = true;
18 32 }
19 33
20 34 #endregion
  @@ -113,8 +127,8 @@
113 127 [TestMethod]
114 128 public void LoginLogoutTest()
115 129 {
116 - CiscoUnityConnectionServerOdbc oServer = new CiscoUnityConnectionServerOdbc(new ConnectionInformixAdoNetDatabaseFunctions("Test"));
117 - var res=oServer.LoginDatabaseBlocking(Server.DatabaseLoginName, Server.DatabaseLoginPassword,Server.DatabaseServerName);
130 + UnityConnectionServerOdbc oServer = new UnityConnectionServerOdbc(new UnityConnectionDatabaseFunctionsInformixAdoNet("Test"));
131 + var res=oServer.LoginDatabaseBlocking(Server.DatabaseServerName,Server.DatabaseLoginName, Server.DatabaseLoginPassword);
118 132 Assert.IsTrue(res.Successful,"Failed to log in to second instance of server:"+res);
119 133
120 134 oServer.LogoutBlocking();
  @@ -148,5 +162,17 @@
148 162 bool ret = Server.IsLanguageInstalled("xyz");
149 163 Assert.IsFalse(ret,"false should be returned if language code cannot be parsed as an int");
150 164 }
165 +
166 +
167 +
168 + [TestMethod]
169 + public void FillDataTableBlocking_InvalidQuery()
170 + {
171 + DataTable oTable;
172 + var res = Server.DatabaseFunctions.FillDataTableBlocking("invalid query string", out oTable);
173 + Assert.IsFalse(res.Successful, "FillDataTableBlocking call should fail with invalid query");
174 + }
175 +
176 +
151 177 }
152 178 }