Пример #1
0
        public void TestConversion()
        {
            LoadSingleton _ls  = LoadSingleton.Instance;
            string        word = "ROTFL";

            sms.Text = word;
            string convert = sms.ConvertAbbreviations(word, _ls.GetAbbreviations());

            Assert.AreEqual(convert, word + " <" + _ls.GetAbbreviations()[word] + ">");
        }
Пример #2
0
 /// <summary>
 /// The only valid way of creating tweets is through this constructor.
 /// </summary>
 /// <param name="sender">The handle of the user (@[name])</param>
 /// <param name="header">The header of the tweet (T + 9 numbers)</param>
 /// <param name="message">The body of the message</param>
 public Tweet(string sender, string header, string message)
 {
     if (Validate(sender, message))
     {
         Header = header;
         Sender = sender;
         Text   = ConvertAbbreviations(message, _ls.GetAbbreviations());
     }
     else
     {
         throw new ArgumentException("This tweet contains invalid data!");
     }
 }