Example #1
0
 public void Remove()
 {
     m_MLText = new MLText();
     m_MLText.AddText("ru", TextRu);
     Assert.IsTrue(m_MLText.ContainsCulture("ru"));
     m_MLText.RemoveText("ru");
     Assert.IsFalse(m_MLText.ContainsCulture("ru"));
 }
Example #2
0
        public void GetText()
        {
            m_MLText = new MLText();
            Assert.AreEqual( string.Empty, m_MLText["ru"] );
            Assert.AreEqual(string.Empty, m_MLText["en"]);

            m_MLText["ru"] = TextRu;
            Assert.AreEqual(TextRu, m_MLText["ru"]);
            Assert.AreEqual(TextRu, m_MLText["en"]);

            m_MLText["en"] = TextEn;
            Assert.AreEqual(TextRu, m_MLText["ru"]);
            Assert.AreEqual(TextEn, m_MLText["en"]);
            Assert.AreEqual(TextEn, m_MLText["en-UK"]);

            m_MLText["en-UK"] = TextEnUK;
            Assert.AreEqual(TextRu, m_MLText["ru"]);
            Assert.AreEqual(TextEn, m_MLText["en"]);
            Assert.AreEqual(TextEnUK, m_MLText["en-UK"]);

            string dcID = MLText.DefaultCultureID;
            string ccID = MLText.CurrentCultureID;

            try
            {
                Assert.AreEqual(TextEn, m_MLText["fr"]);

                MLText.CurrentCultureID = "ru";
                Assert.AreEqual(TextRu, m_MLText["fr"]);

                m_MLText.RemoveText("ru");
                Assert.AreEqual(TextEn, m_MLText["fr"]);

                MLText.DefaultCultureID = "en-UK";
                Assert.AreEqual(TextEnUK, m_MLText["fr"]);
            }
            finally
            {
                MLText.CurrentCultureID = ccID;
                MLText.DefaultCultureID = dcID;
            }
        }