Ejemplo n.º 1
0
        public void ConvertSentence_ReturnSentence_OriginalSentence()
        {
            string sentence  = "if";
            string sentence2 = "if";

            Assert.AreEqual(sentence, Leetspeak.ConvertSentence(sentence2));
        }
Ejemplo n.º 2
0
        public void AccurateTest()
        {
            string tI  = "I hate mondays";
            string lTI = "1 h473 m0nd4yz";

            Assert.AreEqual(lTI, Leetspeak.Leet(tI));
        }
Ejemplo n.º 3
0
        public void SetGetUserInput_TestForSetGetInput_CharArray()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.SetUserInput("Dude");
            CollectionAssert.AreEqual(new char[] { 'D', 'u', 'd', 'e' }, testLeetspeak.GetUserInput());
        }
Ejemplo n.º 4
0
        public void MakeDictionary_TestDictionaryIsMade_DictionaryPopulated()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.MakeDictionary();
            Assert.AreEqual('3', testLeetspeak.GetDictionaryValue('e'));
        }
Ejemplo n.º 5
0
        public void FoundKeyInDictionary_TestForIfKeyIsFound_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 'e';

            testLeetspeak.MakeDictionary();
            Assert.AreEqual(true, testLeetspeak.FoundKeyInDictionary(character));
        }
Ejemplo n.º 6
0
        public void FoundKeyInDictionary_TestForIfKeyIsNotFound_False()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 'M';

            testLeetspeak.MakeDictionary();
            Assert.AreEqual(false, testLeetspeak.FoundKeyInDictionary(character));
        }
Ejemplo n.º 7
0
        public void LetterSAtStart_TestForLetterSInsideOfWord_False()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 's';
            char      prevCharacter = '0';
            int       index         = 1;

            Assert.AreEqual(false, testLeetspeak.LetterSAtStart(character, prevCharacter, index));
        }
Ejemplo n.º 8
0
        public void SetPreviousCharacter_TestAtStartOfArray_Returns0()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.SetUserInput("Dude");
            int index = 0;

            Assert.AreEqual('0', testLeetspeak.SetPreviousCharacter(index));
        }
Ejemplo n.º 9
0
        public void LetterSAtStart_TestForLetterSAtStartOfPhrase_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            char      character     = 's';
            char      prevCharacter = ' ';
            int       index         = 0;

            Assert.AreEqual(true, testLeetspeak.LetterSAtStart(character, prevCharacter, index));
        }
Ejemplo n.º 10
0
        private void MenuItemEncryptionLeetspeak_Click(object sender, EventArgs e)
        {
            if (Document.SelectedText.Length < 1)
            {
                Document.SelectAll();
            }
            Leetspeak leet = new Leetspeak();

            Document.SelectedText = leet.Convert(Document.SelectedText);
        }
Ejemplo n.º 11
0
    static void Main()
    {
        Console.WriteLine("Enter a phrase to have it translated to Leetspeak");

        Leetspeak LeetPhrase = new Leetspeak();

        LeetPhrase.SetPhrase(Console.ReadLine());
        LeetPhrase.SetStringReturn("");

        Translate(LeetPhrase.GetPhrase());
    }
Ejemplo n.º 12
0
        public void SetGetNewPhrase_TestForSetGetNewPhrase_CharArray()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            testLeetspeak.SetNewPhrase(new List <char> {
                'D', 'u', 'd', 'e'
            });
            CollectionAssert.AreEqual(new List <char> {
                'D', 'u', 'd', 'e'
            }, testLeetspeak.GetNewPhrase());
        }
Ejemplo n.º 13
0
        public void IsSReplaceByz_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            string    sentence      = "SsS";
            string    leetSentence  = "Szz";
            string    translated    = testLeetspeak.Translate(sentence);

            Console.WriteLine(translated);
            bool isLeet = (translated.Equals(leetSentence));

            Assert.AreEqual(true, isLeet);
        }
Ejemplo n.º 14
0
        public void FinalTest_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();
            string    sentence      = "Don't you love these 'String' exercises? I do!";
            string    leetSentence  = "D0n'7 y0u l0v3 7h3z3 'S7ring' 3x3rciz3z? 1 d0!";
            string    translated    = testLeetspeak.Translate(sentence);

            Console.WriteLine(translated);
            bool isLeet = (translated.Equals(leetSentence));

            Assert.AreEqual(true, isLeet);
        }
Ejemplo n.º 15
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());
        }
Ejemplo n.º 16
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());
        }
Ejemplo n.º 17
0
        public void DoesInputHasLetterCapitalI_False()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("i", testLeetspeak.ConvertToLeetSpeak("i"));
        }
Ejemplo n.º 18
0
        public void IsLeetspeak_ContainE_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("3", testLeetspeak.LeetspeakGenerator("e"));
        }
Ejemplo n.º 19
0
        public void English_replacez_s()
        {
            Leetspeak testZ = new Leetspeak();

            Assert.AreEqual("Hello in there Melissa", testZ.English("H3ll0 in 7h3r3 M3lissa"));
        }
Ejemplo n.º 20
0
        public void DoesInputHasLetterLowerE_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("3", testLeetspeak.ConvertToLeetSpeak("e"));
        }
Ejemplo n.º 21
0
        public void Translate_replaceS_s()
        {
            Leetspeak testS = new Leetspeak();

            Assert.AreEqual("H3ll0 in 7h3r3 Sally", testS.Translate("Hello in there Sally"));
        }
Ejemplo n.º 22
0
        public void English_replace0_o()
        {
            Leetspeak test0 = new Leetspeak();

            Assert.AreEqual("Hello", test0.English("H3ll0"));
        }
Ejemplo n.º 23
0
        public void English_replace1_I()
        {
            Leetspeak test0 = new Leetspeak();

            Assert.AreEqual("Hello In There", test0.English("H3ll0 1n Th3r3"));
        }
Ejemplo n.º 24
0
        public void IsLeetspeak_SNotFirstLetter_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("z", testLeetspeak.LeetspeakGenerator("sunshine"));
        }
Ejemplo n.º 25
0
        public void English_replace7_t()
        {
            Leetspeak test7 = new Leetspeak();

            Assert.AreEqual("Hello in there", test7.English("H3ll0 in 7h3r3"));
        }
Ejemplo n.º 26
0
        public void DoesInputHasLetterLowerT_False()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("T", testLeetspeak.ConvertToLeetSpeak("T"));
        }
Ejemplo n.º 27
0
        public void IsInputFirstLetterAndS_True()
        {
            Leetspeak testLeetspeak = new Leetspeak();

            Assert.AreEqual("pl3az3 say h0rz3", testLeetspeak.ConvertToLeetSpeak("please say horse"));
        }
Ejemplo n.º 28
0
        public void Translate_replaceS_z()
        {
            Leetspeak testS = new Leetspeak();

            Assert.AreEqual("h3ll0 in 7h3r3 m3lizza", testS.Translate("Hello in there Melissa"));
        }
Ejemplo n.º 29
0
 public void Dispose()
 {
     Leetspeak.ClearAll();
 }
Ejemplo n.º 30
0
        public void ChangeTest()
        {
            string tI = "I hate mondays";

            Assert.AreNotEqual(tI, Leetspeak.Leet(tI));
        }