public void Clear() { m_MLText = new MLText(); m_MLText.AddText("ru", TextRu); m_MLText.AddText("en", TextEn); Assert.IsTrue(m_MLText.ContainsCulture("ru")); Assert.IsTrue(m_MLText.ContainsCulture("en")); m_MLText.Clear(); Assert.IsFalse(m_MLText.ContainsCulture("ru")); Assert.IsFalse(m_MLText.ContainsCulture("en")); }
public void AddText_Exception() { m_MLText = new MLText(); try { m_MLText.AddText("ru_", TextRu); Assert.Fail(); } catch { } }
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")); }
public void IndexerGet() { m_MLText = new MLText(); m_MLText.AddText("ru", TextRu); m_MLText.AddText("en", TextEn); Assert.AreEqual(TextRu, m_MLText["ru"]); Assert.AreEqual(TextEn, m_MLText["en"]); }
public void AddText() { m_MLText = new MLText(); m_MLText.AddText("ru", TextRu); }
public void ContainsCulture_False() { m_MLText = new MLText(); m_MLText.AddText("ru", TextRu); m_MLText.AddText("en", TextEn); Assert.IsFalse(m_MLText.ContainsCulture("fr")); Assert.IsFalse(m_MLText.ContainsCulture("en-UK")); }
public void ContainsCultureInvariant_True() { m_MLText = new MLText(); m_MLText.AddText("en", TextEn); Assert.IsTrue(m_MLText.ContainsCultureInvariant("en")); Assert.IsTrue(m_MLText.ContainsCultureInvariant("en-UK")); }
public void ContainsCultureInvariant_False() { m_MLText = new MLText(); m_MLText.AddText("ru", TextRu); m_MLText.AddText("en", TextEn); Assert.IsFalse(m_MLText.ContainsCultureInvariant("fr")); Assert.IsFalse(m_MLText.ContainsCultureInvariant("gm")); }
public static MLText operator +(MLText ml1, MLText ml2) { if( (ml1 == null) && (ml2 == null) ) return null; if (ml1 == null) return new MLText(ml2); if (ml2 == null) return new MLText(ml1); MLText output = new MLText(ml1); foreach (string cultureID in ml2.Cultures) { if (output.ContainsCulture(cultureID)) { output[cultureID] += ml2[cultureID]; } else { output.AddText(cultureID, ml2[cultureID]); } } return output; }