Subversion Repository Public Repository

ConnectionOdbcSdk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
´╗┐using Cisco.UnityConnection.OdbcSdk;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ConnectionServerOdbcIntegrationTests.UnitTests
{

    [TestClass]
    public class UnityVersionDetailsUnitTests
    {
        [TestMethod]
        public void ToStringNoEs_ToString()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 1;
            oDetails.Minor = 2;
            oDetails.Rev = 3;
            oDetails.Build = 4;

            string strVer = oDetails.ToString();
            Assert.IsTrue(strVer.Equals("1.2(3.4)"), "Version string not correct for noES config:" + strVer);
        }

        [TestMethod]
        public void ToStringStringEs_ToString()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 1;
            oDetails.Minor = 2;
            oDetails.Rev = 3;
            oDetails.Build = 4;
            oDetails.Es = "test";

            string strVer = oDetails.ToString();
            Assert.IsTrue(strVer.Equals("1.2(3.4) test"), "Version string not correct for ES as string config:" + strVer);
        }

        [TestMethod]
        public void ToStringIntEs_ToString()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 1;
            oDetails.Minor = 2;
            oDetails.Rev = 3;
            oDetails.Build = 4;
            oDetails.EsInt = 5;

            string strVer = oDetails.ToString();
            Assert.IsTrue(strVer.Equals("1.2(3.4) ES5"), "Version string not correct for int ES config:" + strVer);
        }

        [TestMethod]
        public void VersionCheck_LessThan()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 2;
            oDetails.Minor = 3;
            oDetails.Rev = 4;
            oDetails.Build = 5;
            oDetails.EsInt = 6;

            Assert.IsFalse(oDetails.IsVersionAtLeast(3, 3, 4, 5, 6), "Version check for at least 3.3(4.5) ES6 did did not fail against version of 2.3(4.5) ES6");
            Assert.IsFalse(oDetails.IsVersionAtLeast(2, 4, 4, 5, 6), "Version check for at least 2.4(4.5) ES6 did did not fail against version of 2.3(4.5) ES6");
            Assert.IsFalse(oDetails.IsVersionAtLeast(2, 3, 5, 5, 6), "Version check for at least 2.3(5.5) ES6 did did not fail against version of 2.3(4.5) ES6");
            Assert.IsFalse(oDetails.IsVersionAtLeast(2, 3, 4, 6, 6), "Version check for at least 2.3(4.6) ES6 did did not fail against version of 2.3(4.5) ES6");
            Assert.IsFalse(oDetails.IsVersionAtLeast(2, 3, 4, 5, 7), "Version check for at least 2.3(4.5) ES7 did did not fail against version of 2.3(4.5) ES6");

        }

        [TestMethod]
        public void VersionCheck_GreaterThan()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 2;
            oDetails.Minor = 3;
            oDetails.Rev = 4;
            oDetails.Build = 5;
            oDetails.EsInt = 6;

            Assert.IsTrue(oDetails.IsVersionAtLeast(1, 3, 4, 5, 6),"Version check for at least 1.3(4.5) ES6 did did not pass against version of 2.3(4.5) ES6");
            Assert.IsTrue(oDetails.IsVersionAtLeast(2, 2, 4, 5, 6),"Version check for at least 2.3(4.5) ES6 did did not pass against version of 2.3(4.5) ES6");
            Assert.IsTrue(oDetails.IsVersionAtLeast(2, 3, 3, 5, 6), "Version check for at least 2.3(3.5) ES6 did did not pass against version of 2.3(4.5) ES6");
            Assert.IsTrue(oDetails.IsVersionAtLeast(2, 3, 4, 4, 6), "Version check for at least 2.3(4.4) ES6 did did not pass against version of 2.3(4.5) ES6");
            Assert.IsTrue(oDetails.IsVersionAtLeast(2, 3, 4, 5, 5), "Version check for at least 2.3(4.5) ES5 did did not pass against version of 2.3(4.5) ES6");
            Assert.IsTrue(oDetails.IsVersionAtLeast(2, 3, 4, 5, 6), "Version check for at least 2.3(4.5) ES6 did did not pass against version of 2.3(4.5) ES6");
        }

        [TestMethod]
        public void VersionCheck_NotConnectionTest()
        {
            UnityVersionDetails oDetails = new UnityVersionDetails();
            oDetails.IsConnection = true;
            oDetails.Major = 2;
            oDetails.Minor = 3;
            oDetails.Rev = 4;
            oDetails.Build = 5;
            oDetails.EsInt = 6;
            oDetails.IsConnection = false;

            Assert.IsFalse(oDetails.IsVersionAtLeast(1,2,3,4,5,true),"Version check required Connection flag but false value did not return false.");
        }
    }
}

Commits for ConnectionOdbcSdk/trunk/ConnectionServerOdbcIntegrationTests/UnitTests/UnityVersionDetailsUnitTests.cs

Diff revisions: vs.
Revision Author Commited Message
9 jlindborg picture jlindborg Fri 30 Aug, 2013 19:10:27 +0000

more unit and integration test setup work.