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

namespace ConnectionServerOdbcIntegrationTests.UnitTests
{
    [TestClass]
    public class ConnectionInformixAdoNetDatabaseFunctionUnitTests: BaseUnitTests
    {
        [ClassInitialize]
        public new static void ClassInitialize(TestContext testContext)
        {
            BaseUnitTests.ClassInitialize(testContext);
        }

        [TestMethod]
        public void GetLogingErrorTests()
        {
            Assert.IsTrue(string.IsNullOrEmpty(ConnectionInformixAdoNetDatabaseFunctions.GetLoginErrorString(null)), 
                "Null should return empty error string");
        }

       
        [TestMethod]
        public void GetRemoteFileName_StartCommandError()
        {
            MockDbFunctions.Setup(x => x.StartNewCommand(It.IsAny<string>(), true)).Returns(false);
            var res = MockDbFunctions.Object.GetRemoteFileName();
            Assert.IsTrue(string.IsNullOrEmpty(res),"Get remote filename should return empty string for an error condition");
        }

        [TestMethod]
        public void GetRemoteFileName_ExecuteProcError()
        {
            MockDbFunctions.Setup(x => x.ExecuteProc()).Returns(new DbFetchResult(){Successful = false} );
            var res = MockDbFunctions.Object.GetRemoteFileName();
            Assert.IsFalse(string.IsNullOrEmpty(res), "Get remote filename should return empty string for an error condition");
        }

    }
}

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

Diff revisions: vs.
Revision Author Commited Message
12 jlindborg picture jlindborg Thu 05 Sep, 2013 01:56:48 +0000

more unit test work.