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
´╗┐using System;
using Cisco.UnityConnection.OdbcSdk;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace UnityConnectionServerOdbcTests
{
    public abstract class BaseUnitTests
    {
        // ReSharper does not handle the Assert. calls in unit test property - turn off checking for unreachable code
        // ReSharper disable HeuristicUnreachableCode

        #region Fields and Properties

        public static Mock<IConnectionDatabaseFunctions> MockDbFunctions { get; set; }

        public static UnityConnectionServerOdbc MockServer { get; set; }

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public static TestContext TestContext { get; set; }

        #endregion


        #region Additional test attributes

        public static void Reset()
        {
            ClassInitialize(TestContext);
        }

        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
            TestContext = testContext;

            //setup mock server interface 
            MockDbFunctions = new Mock<IConnectionDatabaseFunctions>();

            try
            {
                MockServer = new UnityConnectionServerOdbc(MockDbFunctions.Object);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed creating mock server instance:" + ex);
            }

            MockServer.ErrorEvents += MockServerOnErrorEvents;
        }

        private static void MockServerOnErrorEvents(object sender, LogEventArgs logEventArgs)
        {
            Console.WriteLine("Error raised on Mock ODBC server:"+logEventArgs.Line);
        }

        #endregion
    }
}

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

Diff revisions: vs.
Revision Author Commited Message
19 Diff Diff jlindborg picture jlindborg Mon 06 Jan, 2014 22:26:38 +0000

renaming and reorganizing unit tests a bit.

15 Diff Diff jlindborg picture jlindborg Sun 08 Sep, 2013 17:27:35 +0000

2.0.3
Changed class name to be CiscoUnityConnectionServerOdbc
Updated to support 32 or 64 bit projects
Changed order of parameters on login methods at server and DB functions class to match.
Started testing for NuGet package deployment.
Dropped in holder for dev guide docs

9 jlindborg picture jlindborg Fri 30 Aug, 2013 19:10:27 +0000

more unit and integration test setup work.