Ejemplo n.º 1
0
        public void testLangListException()
        {
            IList <string> langList = DetectorFactory.GetLangList();

            Assert.Throws <NotSupportedException>(() => langList.Add("hoge"));
            //langList.Add(1, "hoge");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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");
        }