Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 18 vs 19 for /trunk/ConnectionServerOdbcIntegrationTests/UnitTests/ConnectionServerOdbcUnitTests.cs

Diff revisions: vs.
  @@ -4,7 +4,7 @@
4 4 using Microsoft.VisualStudio.TestTools.UnitTesting;
5 5 using Moq;
6 6
7 - namespace ConnectionServerOdbcIntegrationTests.UnitTests
7 + namespace UnityConnectionServerOdbcTests
8 8 {
9 9 [TestClass]
10 10 public class ConnectionServerOdbcUnitTests:BaseUnitTests
  @@ -22,14 +22,14 @@
22 22 [ExpectedException(typeof(ArgumentException))]
23 23 public void Constructor_NullConnectionServer_Failure()
24 24 {
25 - CiscoUnityConnectionServerOdbc oTest = new CiscoUnityConnectionServerOdbc(null);
25 + UnityConnectionServerOdbc oTest = new UnityConnectionServerOdbc(null);
26 26 Console.WriteLine(oTest);
27 27 }
28 28
29 29 [TestMethod]
30 30 public void Constructor_LocationId_Dispose_Success()
31 31 {
32 - CiscoUnityConnectionServerOdbc oTest = new CiscoUnityConnectionServerOdbc("objectid",new ConnectionInformixAdoNetDatabaseFunctions("name"));
32 + UnityConnectionServerOdbc oTest = new UnityConnectionServerOdbc("objectid", new UnityConnectionDatabaseFunctionsInformixAdoNet("name"));
33 33 Console.WriteLine(oTest);
34 34 oTest.Dispose();
35 35
  @@ -42,13 +42,20 @@
42 42 #region Static Method Tests
43 43
44 44 [TestMethod]
45 + public void GetLogingErrorTests_NullException()
46 + {
47 + Assert.IsTrue(string.IsNullOrEmpty(UnityConnectionDatabaseFunctionsInformixAdoNet.GetLoginErrorString(null)),
48 + "Null should return empty error string");
49 + }
50 +
51 + [TestMethod]
45 52 public void IsValidExtensionTest_AllowBlank()
46 53 {
47 54 const string strExt = "";
48 - bool ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt);
55 + bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
49 56 Assert.IsTrue(ret,"blank extension with zero minimum digit length failed");
50 57
51 - ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt,1);
58 + ret = UnityConnectionServerOdbc.IsValidExtension(strExt, 1);
52 59 Assert.IsFalse(ret, "blank extension with 1 minimum digit length did not fail");
53 60 }
54 61
  @@ -56,10 +63,10 @@
56 63 public void IsValidExtensionTest_MinDigitsCheck()
57 64 {
58 65 const string strExt = "123";
59 - bool ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt);
66 + bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
60 67 Assert.IsTrue(ret, "valid extension with zero minimum digit length failed");
61 68
62 - ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt,4);
69 + ret = UnityConnectionServerOdbc.IsValidExtension(strExt, 4);
63 70 Assert.IsFalse(ret, "3 digit extension with zero 4 minimum digit length did not fail");
64 71 }
65 72
  @@ -67,7 +74,7 @@
67 74 public void IsValidExtensionTest_NonDigitCheck()
68 75 {
69 76 const string strExt = "xxx";
70 - bool ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt);
77 + bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
71 78 Assert.IsFalse(ret, "non digit extension did not fail");
72 79 }
73 80
  @@ -75,7 +82,7 @@
75 82 public void IsValidExtensionTest_NegativeNumberCheck()
76 83 {
77 84 const string strExt = "-12";
78 - bool ret = CiscoUnityConnectionServerOdbc.IsValidExtension(strExt);
85 + bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
79 86 Assert.IsFalse(ret, "negative extension did not fail");
80 87 }
81 88
  @@ -83,27 +90,27 @@
83 90 [TestMethod]
84 91 public void IsValidDatabaseNameTests()
85 92 {
86 - bool ret = CiscoUnityConnectionServerOdbc.IsValidDatabaseName("UnityDirDb");
93 + bool ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityDirDb");
87 94 Assert.IsTrue(ret,"UnityDirDb not recognized as a valid database name");
88 95
89 - ret = CiscoUnityConnectionServerOdbc.IsValidDatabaseName("UnityDynDb");
96 + ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityDynDb");
90 97 Assert.IsTrue(ret, "UnityDynDb not recognized as a valid database name");
91 98
92 - ret = CiscoUnityConnectionServerOdbc.IsValidDatabaseName("UnityMbxDb1");
99 + ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityMbxDb1");
93 100 Assert.IsTrue(ret, "UnityMbxDb1 not recognized as a valid database name");
94 101
95 - ret = CiscoUnityConnectionServerOdbc.IsValidDatabaseName("UnityRptDb");
102 + ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityRptDb");
96 103 Assert.IsTrue(ret, "UnityRptDb not recognized as a valid database name");
97 104
98 - ret = CiscoUnityConnectionServerOdbc.IsValidDatabaseName("Junk");
105 + ret = UnityConnectionServerOdbc.IsValidDatabaseName("Junk");
99 106 Assert.IsFalse(ret, "Junk recognized as a valid database name");
100 107 }
101 108
102 109 [TestMethod]
103 110 public void IntFromBoolTests()
104 111 {
105 - Assert.IsTrue(CiscoUnityConnectionServerOdbc.IntFromBool(true)==1,"Bool value did not evaluate to 1 when true");
106 - Assert.IsTrue(CiscoUnityConnectionServerOdbc.IntFromBool(false) == 0, "Bool value did not evaluate to 0 when false");
112 + Assert.IsTrue(UnityConnectionServerOdbc.IntFromBool(true)==1,"Bool value did not evaluate to 1 when true");
113 + Assert.IsTrue(UnityConnectionServerOdbc.IntFromBool(false) == 0, "Bool value did not evaluate to 0 when false");
107 114 }
108 115
109 116 #endregion