예제 #1
0
 /// <summary>
 /// Sets translation keys from an array of lines.
 /// </summary>
 /// <param name="lines">The lines containing the colon-separated name and value of the translation keys</param>
 public void SetDictionary(string[] lines)
 {
     TranslationDictionary.Clear();
     foreach (var line in lines)
     {
         if (line.Contains(':'))
         {
             var split = line.Split(new[] { ':' }, 2);
             var key   = split[0];
             var val   = split[1].TrimStart();
             TranslationDictionary[key] = val;
         }
     }
 }
예제 #2
0
        public void Clear_Works()
        {
            var t = new Translation()
            {
                FromWord     = "siin",
                FromLanguage = "Estonian",
                ToWord       = "here",
                ToLanguage   = "English"
            };

            _translationDictionary.Translations.Add(t);

            _translationDictionary.Clear();

            Assert.AreEqual(0, _translationDictionary.Translations.Count);
        }