Ejemplo n.º 1
0
        public void Test_DecodeMessage(string encodedMessage, string decodedMessage)
        {
            AlphabetUtility sut    = new AlphabetUtility(encodedMessage);
            var             result = sut.DecodeMessage();

            Assert.That(result, Is.EqualTo(decodedMessage));
        }
Ejemplo n.º 2
0
        public void Test_CycleLetters(string input, string expectedResult)
        {
            AlphabetUtility sut    = new AlphabetUtility(input);
            var             result = sut.CycleLetters();

            Assert.That(result, Is.EqualTo(expectedResult));
        }
Ejemplo n.º 3
0
        public void Test_FindMostQuantityLetter()
        {
            string input  = "The quick brown fox jumps over the lazy dog";
            var    result = AlphabetUtility.FindMostQuantityLetter(input);

            Assert.That(result, Is.EqualTo(4));
        }
Ejemplo n.º 4
0
        public void Test_CalculateBankThief(int timeNeededByPolice, int wordsPerMinute, int timeAfterSentence,
                                            int timeAfterAllSentences, string inputSentence, string expected)
        {
            var robberyData = new RobberyData(timeNeededByPolice, wordsPerMinute, timeAfterSentence,
                                              timeAfterAllSentences, inputSentence);
            var result = AlphabetUtility.CalculateBankThief(robberyData);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 5
0
        public void Test_GetIndexOfLetterInAlphabet()
        {
            string alphabet = "abcdefghijklmnopqrstuvwxyz";
            string input    = "DAbE";
            var    indexes  = AlphabetUtility.GetIndexOfLettersInAlphabet(alphabet, input);

            CollectionAssert.Contains(indexes, 3);
            CollectionAssert.Contains(indexes, 0);
            CollectionAssert.Contains(indexes, 1);
            CollectionAssert.Contains(indexes, 4);
            Assert.That(indexes.Count, Is.EqualTo(4));
        }
Ejemplo n.º 6
0
        public void Test_DecodeMessageAlternatelyFromLeftRight(string input, string expected)
        {
            var result = AlphabetUtility.DecodeMessageAlternatelyFromLeftRight(input);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 7
0
        public void Test_EncodeMessage(string input, string expected)
        {
            var output = AlphabetUtility.EncodeMessage(input);

            Assert.That(output, Is.EqualTo(expected));
        }
Ejemplo n.º 8
0
        public void Test_CaesarBoxCipher(string input, string output)
        {
            AlphabetUtility sut = new AlphabetUtility(input);

            Assert.That(sut.DecodeCaesarBoxCipher(), Is.EqualTo(output));
        }
Ejemplo n.º 9
0
        public void Test_RunLengthEncoding2(string input, string output)
        {
            AlphabetUtility sut = new AlphabetUtility(input);

            Assert.That(sut.RunLengthEncoding2(), Is.EqualTo(output));
        }
Ejemplo n.º 10
0
        public void Test_ROT13Cipher(string expected, string input)
        {
            var result = AlphabetUtility.Encode_Rot13Cipher(input);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 11
0
        public void Test_GetCountOfLetters(string input, int expected)
        {
            var result = AlphabetUtility.GetCountOfLetters(input);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 12
0
        public void Test_DoLogicalOrWithCharSubtraction(string input1, string input2, string expected)
        {
            string result = AlphabetUtility.DoLogicalOrWithCharSubtraction(input1, input2);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 13
0
        public void Test_ValidateUpperCaseLowerCaseAndNumberInput(string input, string expected)
        {
            var result = AlphabetUtility.ValidateUpperCaseLowerCaseAndNumberInput(input);

            Assert.That(result, Is.EqualTo(expected));
        }
Ejemplo n.º 14
0
        public void Test_FindFirstNotCorrectlyPlacedLetter(string input, string output)
        {
            AlphabetUtility sut = new AlphabetUtility(input);

            Assert.That(sut.FindFirstNotCorrectlyPlacedLetter(), Is.EqualTo(output));
        }
Ejemplo n.º 15
0
        public void Test_Orang_utanEncoding(string input, string expected)
        {
            string result = AlphabetUtility.EncodeOrang_utan(input);

            Assert.That(result, Is.EqualTo(expected));
        }