Subversion Repository Public Repository

ConnectionOdbcSdk

Diff Revisions 20 vs 21 for /trunk/ConnectionServerOdbcIntegrationTests/UnitTests/ConnectionServerOdbcUnitTests.cs

Diff revisions: vs.
  @@ -22,14 +22,14 @@
22 22 [ExpectedException(typeof(ArgumentException))]
23 23 public void Constructor_NullConnectionServer_Failure()
24 24 {
25 - UnityConnectionServerOdbc oTest = new UnityConnectionServerOdbc(null);
25 + UnityConnectionServerOdbcSdk oTest = new UnityConnectionServerOdbcSdk(null);
26 26 Console.WriteLine(oTest);
27 27 }
28 28
29 29 [TestMethod]
30 30 public void Constructor_LocationId_Dispose_Success()
31 31 {
32 - UnityConnectionServerOdbc oTest = new UnityConnectionServerOdbc("objectid", new UnityConnectionDatabaseFunctions("testing"));
32 + UnityConnectionServerOdbcSdk oTest = new UnityConnectionServerOdbcSdk("objectid", "testing");
33 33 Console.WriteLine(oTest);
34 34 oTest.Dispose();
35 35
  @@ -44,18 +44,31 @@
44 44 [TestMethod]
45 45 public void GetLogingErrorTests_NullException()
46 46 {
47 - Assert.IsTrue(string.IsNullOrEmpty(UnityConnectionDatabaseInterfaceInformixAdoNet.GetLoginErrorString(null)),
47 + using (UnityConnectionServerOdbcSdk oTemp = new UnityConnectionServerOdbcSdk("testing"))
48 + {
49 + Assert.IsTrue(string.IsNullOrEmpty(oTemp.GetLoginErrorString(null)),
48 50 "Null should return empty error string");
51 + }
52 + }
53 +
54 + [TestMethod]
55 + public void GetLogingErrorTests_InvalidObject()
56 + {
57 + using (UnityConnectionServerOdbcSdk oTemp = new UnityConnectionServerOdbcSdk("testing"))
58 + {
59 + Assert.IsTrue(string.IsNullOrEmpty(oTemp.GetLoginErrorString(new object())),
60 + "Invalid exception object should return empty error string");
61 + }
49 62 }
50 63
51 64 [TestMethod]
52 65 public void IsValidExtensionTest_AllowBlank()
53 66 {
54 67 const string strExt = "";
55 - bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
68 + bool ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt);
56 69 Assert.IsTrue(ret,"blank extension with zero minimum digit length failed");
57 70
58 - ret = UnityConnectionServerOdbc.IsValidExtension(strExt, 1);
71 + ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt, 1);
59 72 Assert.IsFalse(ret, "blank extension with 1 minimum digit length did not fail");
60 73 }
61 74
  @@ -63,10 +76,10 @@
63 76 public void IsValidExtensionTest_MinDigitsCheck()
64 77 {
65 78 const string strExt = "123";
66 - bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
79 + bool ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt);
67 80 Assert.IsTrue(ret, "valid extension with zero minimum digit length failed");
68 81
69 - ret = UnityConnectionServerOdbc.IsValidExtension(strExt, 4);
82 + ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt, 4);
70 83 Assert.IsFalse(ret, "3 digit extension with zero 4 minimum digit length did not fail");
71 84 }
72 85
  @@ -74,7 +87,7 @@
74 87 public void IsValidExtensionTest_NonDigitCheck()
75 88 {
76 89 const string strExt = "xxx";
77 - bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
90 + bool ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt);
78 91 Assert.IsFalse(ret, "non digit extension did not fail");
79 92 }
80 93
  @@ -82,7 +95,7 @@
82 95 public void IsValidExtensionTest_NegativeNumberCheck()
83 96 {
84 97 const string strExt = "-12";
85 - bool ret = UnityConnectionServerOdbc.IsValidExtension(strExt);
98 + bool ret = UnityConnectionServerOdbcSdk.IsValidExtension(strExt);
86 99 Assert.IsFalse(ret, "negative extension did not fail");
87 100 }
88 101
  @@ -90,27 +103,27 @@
90 103 [TestMethod]
91 104 public void IsValidDatabaseNameTests()
92 105 {
93 - bool ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityDirDb");
106 + bool ret = UnityConnectionServerOdbcSdk.IsValidDatabaseName("UnityDirDb");
94 107 Assert.IsTrue(ret,"UnityDirDb not recognized as a valid database name");
95 108
96 - ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityDynDb");
109 + ret = UnityConnectionServerOdbcSdk.IsValidDatabaseName("UnityDynDb");
97 110 Assert.IsTrue(ret, "UnityDynDb not recognized as a valid database name");
98 111
99 - ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityMbxDb1");
112 + ret = UnityConnectionServerOdbcSdk.IsValidDatabaseName("UnityMbxDb1");
100 113 Assert.IsTrue(ret, "UnityMbxDb1 not recognized as a valid database name");
101 114
102 - ret = UnityConnectionServerOdbc.IsValidDatabaseName("UnityRptDb");
115 + ret = UnityConnectionServerOdbcSdk.IsValidDatabaseName("UnityRptDb");
103 116 Assert.IsTrue(ret, "UnityRptDb not recognized as a valid database name");
104 117
105 - ret = UnityConnectionServerOdbc.IsValidDatabaseName("Junk");
118 + ret = UnityConnectionServerOdbcSdk.IsValidDatabaseName("Junk");
106 119 Assert.IsFalse(ret, "Junk recognized as a valid database name");
107 120 }
108 121
109 122 [TestMethod]
110 123 public void IntFromBoolTests()
111 124 {
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");
125 + Assert.IsTrue(UnityConnectionServerOdbcSdk.IntFromBool(true)==1,"Bool value did not evaluate to 1 when true");
126 + Assert.IsTrue(UnityConnectionServerOdbcSdk.IntFromBool(false) == 0, "Bool value did not evaluate to 0 when false");
114 127 }
115 128
116 129 #endregion