예제 #1
0
        public void MakeDictionary_TestDictionaryIsMade_DictionaryPopulated()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.MakeDictionary();
            Assert.AreEqual('3', testLeetspeak.GetDictionaryValue('e'));
        }
예제 #2
0
        public void FoundKeyInDictionary_TestForIfKeyIsFound_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 'e';

            testLeetspeak.MakeDictionary();
            Assert.AreEqual(true, testLeetspeak.FoundKeyInDictionary(character));
        }
예제 #3
0
        public void FoundKeyInDictionary_TestForIfKeyIsNotFound_False()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 'M';

            testLeetspeak.MakeDictionary();
            Assert.AreEqual(false, testLeetspeak.FoundKeyInDictionary(character));
        }
예제 #4
0
        public void ReplaceValues_TestValuesAreReplaced_PhraseIsConverted()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.MakeDictionary();
            testLeetspeak.SetUserInput("sleets");
            List <char> leetWord = new List <char>()
            {
                's', 'l', '3', '3', '7', 'z'
            };

            CollectionAssert.AreEqual(leetWord, testLeetspeak.ReplaceValues());
        }
예제 #5
0
        public void CreateLeetspeak_TestValuesAreReplaced_PhraseIsConverted()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.SetUserInput("sleets");
            testLeetspeak.MakeDictionary();
            testLeetspeak.CreateLeetspeak();
            List <char> leetPhrase = new List <char> {
                's', 'l', '3', '3', '7', 'z'
            };

            CollectionAssert.AreEqual(leetPhrase, testLeetspeak.GetModifiedPhrase());
        }