Exemplo n.º 1
0
        public void eReplacedWith3_True()
        {
            LeetspeakTranslator newTranslator = new LeetspeakTranslator("Bear");
            string arrStr = newTranslator.ArrayMaker("Bear");

            Assert.AreEqual("B3ar", arrStr);
        }
Exemplo n.º 2
0
        public void Translate_StringContainingTReplacesTWithSeven_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "T";

            Assert.AreEqual("7", translator.Translate(s));
        }
Exemplo n.º 3
0
        public void Translate_StringContainingSReplacesSWithZ_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "s";

            Assert.AreEqual("z", translator.Translate(s));
        }
Exemplo n.º 4
0
        public void Translate_StringContainingCapitalIReplacesIWithOne_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "I";

            Assert.AreEqual("1", translator.Translate(s));
        }
Exemplo n.º 5
0
        public void Translate_StringContainingOReplacesOWithZero_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "O";

            Assert.AreEqual("0", translator.Translate(s));
        }
Exemplo n.º 6
0
        public void Translate_StringContainingEReplacesEWithThree_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "E";

            Assert.AreEqual("3", translator.Translate(s));
        }
Exemplo n.º 7
0
        public void Translate_ReplaceTWith7_String()
        {
            string sentence = "h3ll017";
            LeetspeakTranslator newSentence = new LeetspeakTranslator(sentence);

            Assert.AreEqual(sentence, newSentence.Translate("helloIt"));
        }
Exemplo n.º 8
0
        public ActionResult Translate(string word)
        {
            LeetspeakTranslator translator = new LeetspeakTranslator(word);

            translator.Translate();
            return(View(translator));
        }
Exemplo n.º 9
0
        public void Translate_ReplaceOWith0_String()
        {
            string sentence = "0rang3";
            LeetspeakTranslator newSentence = new LeetspeakTranslator(sentence);

            Assert.AreEqual(sentence, newSentence.Translate("orange"));
        }
Exemplo n.º 10
0
        public void Translate_ReplaceEWith3_String()
        {
            string sentence = "3pic";
            LeetspeakTranslator newSentence = new LeetspeakTranslator(sentence);

            Assert.AreEqual(sentence, newSentence.Translate("Epic"));
        }
Exemplo n.º 11
0
        public void Translate_ReplaceNotFirstLetterSWithz_String()
        {
            string sentence = "h3ll017z";
            LeetspeakTranslator newSentence = new LeetspeakTranslator(sentence);

            Assert.AreEqual(sentence, newSentence.Translate("helloIts"));
        }
Exemplo n.º 12
0
        public void Translate_StringContainsUnaffectedLetters_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "aEOITs";

            Assert.AreEqual("a3017z", translator.Translate(s));
        }
Exemplo n.º 13
0
        public void Translate_ConvertsStringInput_String()
        {
            string stringOutput            = "hll";
            LeetspeakTranslator translator = new LeetspeakTranslator();

            Assert.AreEqual(stringOutput, translator.Translate("hll"));
        }
Exemplo n.º 14
0
        public void Translate_ConvertsStringInput_StringOutputChangeO()
        {
            string stringOutput            = "h3ll0";
            LeetspeakTranslator translator = new LeetspeakTranslator();

            Assert.AreEqual(stringOutput, translator.Translate("hello"));
        }
Exemplo n.º 15
0
        public void Translate_ConvertsStringInput_StringOutputChangeT()
        {
            string stringOutput            = "L37 g0";
            LeetspeakTranslator translator = new LeetspeakTranslator();

            Assert.AreEqual(stringOutput, translator.Translate("Let go"));
        }
Exemplo n.º 16
0
        public void Translate_ConvertsStringInput_StringOutputChangeS()
        {
            string stringOutput            = "s0 l37z g0";
            LeetspeakTranslator translator = new LeetspeakTranslator();

            Assert.AreEqual(stringOutput, translator.Translate("so lets go"));
        }
        public void LeetSpeak_Set_Method_Set_InValid_Value()
        {
            LeetspeakTranslator word = new LeetspeakTranslator("Epicodus");
            string setValue          = "Seattle";

            word.SetWords(setValue);
            Assert.AreNotEqual("Epi", word.GetWords());
        }
        public void Translate_ConvertsStringInput_StringOutputChangeI()
        {
            string stringOutput            = "1 d0";
            LeetspeakTranslator translator = new LeetspeakTranslator("I do");

            translator.Translate();
            Assert.AreEqual(stringOutput, translator.TranslatedInput);
        }
Exemplo n.º 19
0
    public static void Main()
    {
        Console.WriteLine("Enter a word or sentence to translate!");
        string wordToTranslate = Console.ReadLine();
        LeetspeakTranslator translatedSentence = new LeetspeakTranslator();

        Console.WriteLine(translatedSentence.Translating(wordToTranslate));
    }
Exemplo n.º 20
0
        public void WordTurningIntoArray_True()
        {
            LeetspeakTranslator newTranslator = new LeetspeakTranslator("Bear");
            string arrStr    = newTranslator.ArrayMaker("Bear");
            int    strLength = arrStr.Length;

            Assert.AreEqual(4, arrStr.Length);
        }
Exemplo n.º 21
0
        public void Translate_StringWithMultipleWordsToLeetSpeak_String()
        {
            LeetspeakTranslator translator = new LeetspeakTranslator();
            string s = "Don't you love these 'String' exercises? I do!";

            Assert.AreEqual("D0n'7 y0u l0v3 7h3z3 'S7ring' 3x3rciz3z? 1 d0!", translator.Translate(s));
            // string s = "'Strings strings";
            // Assert.AreEqual("'S7r1ngz s7r1ngz", translator.Translate(s));
        }
Exemplo n.º 22
0
    public static void Main()
    {
        LeetspeakTranslator myTranslation = new LeetspeakTranslator();

        Console.WriteLine("Enter anything to translate: ");
        string input = Console.ReadLine();

        Console.WriteLine(myTranslation.Translate(input));
    }
        public ActionResult Translate()
        {
            LeetspeakTranslator.ClearAll();
            LeetspeakTranslator leet      = new LeetspeakTranslator(Request.Form["input-word"]);
            List <string>       translate = new List <string>();

            translate = leet.ChangeLetter();
            return(View(translate));
        }
        public void ChangeLetter_ItoOne_One()
        {
            //Arrange
            List <string> expected = new List <string> {
                "1nf3ri0r"
            };

            //Act
            LeetspeakTranslator newWord = new LeetspeakTranslator("Inferior");
            List <string>       actual  = newWord.ChangeLetter();

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
        public void ChangeLetter_SToZ_Z()
        {
            //Arrange
            List <string> expected = new List <string> {
                "1n73ri0rz"
            };

            //Act
            LeetspeakTranslator newWord = new LeetspeakTranslator("Interiors");
            List <string>       actual  = newWord.ChangeLetter();

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
        public void ChangeLetter_FirstLetterSNoChange_S()
        {
            //Arrange
            List <string> expected = new List <string> {
                "z007z"
            };

            //Act
            LeetspeakTranslator newWord = new LeetspeakTranslator("Soots");
            List <string>       actual  = newWord.ChangeLetter();

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
        public void ChangeLetter_EToThree_Three()
        {
            //Arrange
            List <string> expected = new List <string> {
                "m3"
            };

            //Act
            LeetspeakTranslator newWord = new LeetspeakTranslator("me");

            List <string> actual = newWord.ChangeLetter();

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
        public void ChangeLetter_OToZero_Zero()
        {
            //Arrange
            List <string> expected = new List <string> {
                "n30n"
            };

            //Act
            LeetspeakTranslator newWord = new LeetspeakTranslator("neon");

            List <string> actual = newWord.ChangeLetter();

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
Exemplo n.º 29
0
        public void Translate_ConvertssToz_z()
        {
            LeetspeakTranslator le = new LeetspeakTranslator();

            Assert.AreEqual("D0n'7 y0u l0v3 7h3z3 'S7ring' 3x3rciz3z? 1 d0!", LeetspeakTranslator.Translate("Don't you love these 'String' exercises? I do!"));
        }
Exemplo n.º 30
0
        public void Translate_ConvertstTo7_7()
        {
            LeetspeakTranslator le = new LeetspeakTranslator();

            Assert.AreEqual("A l07 0f b337", LeetspeakTranslator.Translate("A lot of beet")); // A lO7 0f b337s
        }