예제 #1
0
        public void testLangListException()
        {
            IList <string> langList = DetectorFactory.GetLangList();

            Assert.Throws <NotSupportedException>(() => langList.Add("hoge"));
            //langList.Add(1, "hoge");
        }
예제 #2
0
        public void testLangList()
        {
            IList <string> langList = DetectorFactory.GetLangList();

            Assert.AreEqual(langList.Count, 3);
            Assert.AreEqual(langList[0], "en");
            Assert.AreEqual(langList[1], "fr");
            Assert.AreEqual(langList[2], "ja");
        }
예제 #3
0
        public void testFactoryFromJsonString()
        {
            DetectorFactory.Clear();
            List <string> profiles = new List <string>();

            profiles.Add(JSON_LANG1);
            profiles.Add(JSON_LANG2);
            DetectorFactory.LoadProfile(profiles);
            IList <string> langList = DetectorFactory.GetLangList();

            Assert.AreEqual(langList.Count, 2);
            Assert.AreEqual(langList[0], "lang1");
            Assert.AreEqual(langList[1], "lang2");
        }