예제 #1
0
        public void NLSMap_Get_Name()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}";

            var nls = new NLSMap(content);

            var name = nls.Get(NLSMap.GetParts.Name);

            Aver.AreEqual("Cucumber", name);

            name = nls.Get(NLSMap.GetParts.Name, "deu");
            Aver.AreEqual("Gurke", name);

            name = nls.Get(NLSMap.GetParts.Name, "XXX");
            Aver.AreEqual("Cucumber", name);

            name = nls.Get(NLSMap.GetParts.Name, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(name);
        }
예제 #2
0
        public void NLSMap_Get_Descr()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}";

            var nls = new NLSMap(content);

            var descr = nls.Get(NLSMap.GetParts.Description);

            Aver.AreEqual("It is green", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "deu");
            Aver.AreEqual("Es ist grün", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "XXX");
            Aver.AreEqual("It is green", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(descr);
        }
예제 #3
0
        public void NLSMap_Get_DescrAndName()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var dan = nls.Get(NLSMap.GetParts.DescriptionAndName);

            Aver.AreEqual("It is green - Cucumber", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "deu");
            Aver.AreEqual("Es ist grün - Gurke", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "XXX");
            Aver.AreEqual("It is green - Cucumber", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "YYY", concat: "::");
            Aver.AreEqual("It is green::Cucumber", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "rus");
            Aver.AreEqual("On Zeleniy", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(dan);
        }
예제 #4
0
        public void NLSMap_Get_NameAndDescr()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var nand = nls.Get(NLSMap.GetParts.NameAndDescription);

            Aver.AreEqual("Cucumber - It is green", nand);

            nand = nls.Get(NLSMap.GetParts.NameAndDescription, "deu");
            Aver.AreEqual("Gurke - Es ist grün", nand);

            nand = nls.Get(NLSMap.GetParts.NameAndDescription, "XXX");
            Aver.AreEqual("Cucumber - It is green", nand);

            nand = nls.Get(NLSMap.GetParts.NameAndDescription, "YYY", concat: "::");
            Aver.AreEqual("Cucumber::It is green", nand);

            nand = nls.Get(NLSMap.GetParts.NameAndDescription, "rus");
            Aver.AreEqual("On Zeleniy", nand);

            nand = nls.Get(NLSMap.GetParts.NameAndDescription, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(nand);
        }
예제 #5
0
        public void NLSMap_Get_DescrOrName()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var dorn = nls.Get(NLSMap.GetParts.DescriptionOrName);

            Aver.AreEqual("It is green", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "deu");
            Aver.AreEqual("Es ist grün", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "XXX");
            Aver.AreEqual("It is green", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "rus");
            Aver.AreEqual("On Zeleniy", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(dorn);
        }
예제 #6
0
        public void NLSMap_Get_NameOrDescr()
        {
            var content = "{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var nord = nls.Get(NLSMap.GetParts.NameOrDescription);

            Aver.AreEqual("Cucumber", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "deu");
            Aver.AreEqual("Gurke", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "XXX");
            Aver.AreEqual("Cucumber", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "rus");
            Aver.AreEqual("On Zeleniy", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "XXX", dfltLangIso: "ZZZ");
            Aver.IsNull(nord);
        }
예제 #7
0
파일: JSON.cs 프로젝트: yhhno/nfx
        public void NLSMap_Get_NameOrDescr()
        {
            var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var nord = nls.Get(NLSMap.GetParts.NameOrDescription);
            Assert.AreEqual("Cucumber", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "deu");
            Assert.AreEqual("Gurke", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "XXX");
            Assert.AreEqual("Cucumber", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "rus");
            Assert.AreEqual("On Zeleniy", nord);

            nord = nls.Get(NLSMap.GetParts.NameOrDescription, "XXX", dfltLangIso: "ZZZ");
            Assert.IsNull(nord);
        }
예제 #8
0
파일: JSON.cs 프로젝트: yhhno/nfx
        public void NLSMap_Get_Name()
        {
            var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}";

            var nls = new NLSMap(content);

            var name = nls.Get(NLSMap.GetParts.Name);
            Assert.AreEqual("Cucumber", name);

            name = nls.Get(NLSMap.GetParts.Name, "deu");
            Assert.AreEqual("Gurke", name);

            name = nls.Get(NLSMap.GetParts.Name, "XXX");
            Assert.AreEqual("Cucumber", name);

            name = nls.Get(NLSMap.GetParts.Name, "XXX", dfltLangIso: "ZZZ");
            Assert.IsNull(name);
        }
예제 #9
0
파일: JSON.cs 프로젝트: yhhno/nfx
        public void NLSMap_Get_DescrOrName()
        {
            var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var dorn = nls.Get(NLSMap.GetParts.DescriptionOrName);
            Assert.AreEqual("It is green", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "deu");
            Assert.AreEqual("Es ist grün", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "XXX");
            Assert.AreEqual("It is green", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "rus");
            Assert.AreEqual("On Zeleniy", dorn);

            dorn = nls.Get(NLSMap.GetParts.DescriptionOrName, "XXX", dfltLangIso: "ZZZ");
            Assert.IsNull(dorn);
        }
예제 #10
0
파일: JSON.cs 프로젝트: yhhno/nfx
        public void NLSMap_Get_DescrAndName()
        {
            var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}, rus: { d: 'On Zeleniy'}}";

            var nls = new NLSMap(content);

            var dan = nls.Get(NLSMap.GetParts.DescriptionAndName);
            Assert.AreEqual("It is green - Cucumber", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "deu");
            Assert.AreEqual("Es ist grün - Gurke", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "XXX");
            Assert.AreEqual("It is green - Cucumber", dan);

             dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "YYY", concat: "::");
            Assert.AreEqual("It is green::Cucumber", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "rus");
            Assert.AreEqual("On Zeleniy", dan);

            dan = nls.Get(NLSMap.GetParts.DescriptionAndName, "XXX", dfltLangIso: "ZZZ");
            Assert.IsNull(dan);
        }
예제 #11
0
파일: JSON.cs 프로젝트: yhhno/nfx
        public void NLSMap_Get_Descr()
        {
            var content="{eng: {n: 'Cucumber',d: 'It is green'}, deu: {n: 'Gurke', d: 'Es ist grün'}}";

            var nls = new NLSMap(content);

            var descr = nls.Get(NLSMap.GetParts.Description);
            Assert.AreEqual("It is green", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "deu");
            Assert.AreEqual("Es ist grün", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "XXX");
            Assert.AreEqual("It is green", descr);

            descr = nls.Get(NLSMap.GetParts.Description, "XXX", dfltLangIso: "ZZZ");
            Assert.IsNull(descr);
        }