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

namespace ConnectionServerOdbcIntegrationTests.IntegrationTests
{
    [TestClass]
    public class LanguageHelperTests : BaseUnitTests
    {
         #region Additional test attributes

       #endregion

        [TestMethod]
        public void GetLanguageNameFromLanguageId_InvalidLanguage()
        {
            string strLanguage= LanguageHelper.GetLanguageNameFromLanguageId(7777);
            Assert.AreEqual(strLanguage,"Undefined","Invalid language code should return undefined string:"+strLanguage);
        }

        [TestMethod]
        public void GetLanguageNameFromLanguageId_JpnLanguage()
        {
            string strLanguage = LanguageHelper.GetLanguageNameFromLanguageId(1041);
            Assert.AreEqual(strLanguage, "Japanese","Language Id 1041 did not return Japanes string:"+strLanguage);
        }

        [TestMethod]
        public void GetLanguageIdFromLanguageEnum_JpnLanguage()
        {
            int iLang = LanguageHelper.GetLanguageIdFromLanguageEnum(LanguageCodes.Japanese);
            Assert.AreEqual(iLang,1041,"Japanese language enum did not return an Id of 1041:"+iLang);
        }

        [TestMethod]
        public void GetLanguageIdFromLanguageEnum_UndefinedLanguage()
        {
            int iLang = LanguageHelper.GetLanguageIdFromLanguageEnum(LanguageCodes.Undefined);
            Assert.AreEqual(iLang, -1, "Undefined language enum did not return an Id of -1:" + iLang);
        }

        [TestMethod]
        public void GetLanguageIdFromLanguageEnum_InvalidLanguage()
        {
            int iLang = LanguageHelper.GetLanguageIdFromLanguageEnum((LanguageCodes)8888);
            Assert.AreEqual(iLang, -1, "Invalid language enum did not return an Id of -1:" + iLang);
        }

        [TestMethod]
        public void GetLanguageIdFromShortName_InvalidLanguage()
        {
            int iLang = LanguageHelper.GetLanguageIdFromShortName("XYZ");
            Assert.AreEqual(iLang, -1, "Undefined language did not return an Id of -1:" + iLang);
        }

        [TestMethod]
        public void GetLanguageIdFromShortName_EnxLanguage()
        {
            int iLang = LanguageHelper.GetLanguageIdFromShortName("ENX");
            Assert.AreEqual(iLang, 33801, "ENX language did not return an Id of 33801:" + iLang);
        }

    }
}

Commits for ConnectionOdbcSdk/trunk/ConnectionServerOdbcIntegrationTests/UnitTests/LanguageHelperUnitTests.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.