예제 #1
0
        public void CheckAcronym_When_UsingSpecialConversion()
        {
            Dictionary <string, string> dict1 = new Dictionary <string, string>();
            Dictionary <string, string> dict2 = new Dictionary <string, string>();

            dict1.Add("and", "&");
            dict2.Add("and", "");
            dict2.Add("the", "");
            dict2.Add("of", "");

            Assert.AreEqual("R&B", AcronymFactory.GetAcronym("rythm and blues", dict1));
            Assert.AreEqual("RB", AcronymFactory.GetAcronym("rythm and blues", dict2));
            Assert.AreEqual("TIOE&EE", AcronymFactory.GetAcronym("The Institute of Electrical and Electronics Engineers", dict1));
            Assert.AreEqual("IEEE", AcronymFactory.GetAcronym("The Institute of Electrical and Electronics Engineers", dict2));
        }
예제 #2
0
 public void CheckAcronym_When_EmptyStringIsPassed()
 {
     Assert.AreEqual("", AcronymFactory.GetAcronym(""));
 }
예제 #3
0
 public void CheckAcronym_When_StringWithLowerCaseIsPassed()
 {
     Assert.AreEqual("AJAX", AcronymFactory.GetAcronym("Asynchronous javascript and XML"));
     Assert.AreEqual("RAB", AcronymFactory.GetAcronym("rythm and blues"));
 }
예제 #4
0
 public void CheckAcronym_When_MoreEmptySpacesBetweenWords()
 {
     Assert.AreEqual("LOL", AcronymFactory.GetAcronym("laughing   out      loud"));
 }
예제 #5
0
 public void CheckAcronym_When_StringWithUpperCaseIsPassed()
 {
     Assert.AreEqual("IDK", AcronymFactory.GetAcronym("I Don't Know"));
     Assert.AreEqual("LMSA", AcronymFactory.GetAcronym("Let's Make Some Acronyms"));
 }