public void InputStringNumbersWithInvalidValue()
        {
            string        str           = "abcd";
            MaxCharacters maxCharacters = new MaxCharacters();

            Assert.ThrowsException <InvalidStringException>(() => maxCharacters.GetMaxCountSameNumbers(str));
        }
Exemple #2
0
        public static void ReverseString()
        {
            //--Calls the StringHelper class to Reverse a string. Look in StringHelper Class
            // example : Console.WriteLine(StringManipulation.StringHelper.ReverstringLoopForEachLoop("framework"));


            //int a = 10;
            //int b = 20;
            //Swap2Numbers.Swap(ref a, ref b);
            //Console.WriteLine("a is now: " + a + "b is now : " + b);
            //Console.Read();

            //--Call palindrome class and return true or false if a words equals the same forward as backwards
            //Example : Console.WriteLine(StringManipulation.Palindrome.IsPalindromeReversingTheString(""));

            // --Call ReverseInt class andGiven an integer, return an integer that is the reverse
            // Console.WriteLine(ReverseInt.ReverseInt1(-29));

            //Given a string, return the character that is most commonly used in the string.
            Console.WriteLine(MaxCharacters.GetMaxCharacterUsingLinq("HelloH TherooOe!"));


            //Write a program that console logs the numbers from 1 to n. But for multiples of three print
            //FizzBuzz.DoFizzBuzz();

            //Given an array and chunk size, divide the array into many subarrays
            // where each subarray is of length size
            // var test = Chunk.Split(new string[]{ "1", "2", "3", "4", "5", "6", "7"}, 2);


            //Anagrams = Check to see if two provided strings are anagrams of eachother
            //Anagrams.MyAnagram("heater!", "reheat");
        }
        public void InputEmptyStringInSameNumbers()
        {
            string        str           = "";
            MaxCharacters maxCharacters = new MaxCharacters();

            Assert.ThrowsException <System.Exception>(() => maxCharacters.GetMaxCountSameNumbers(str));
        }
        public void InputStringLettersWithInvalidValue()
        {
            string        str           = "1234";
            MaxCharacters maxCharacters = new MaxCharacters();

            Assert.ThrowsException <InvalidStringException>(() => maxCharacters.GetMaxCountSameLatinLetters(str));
        }
        public void InputStringNumbersWithMiddleSameValue()
        {
            string        str           = "122234";
            int           expected      = 3;
            MaxCharacters maxCharacters = new MaxCharacters();
            int           actual        = maxCharacters.GetMaxCountSameNumbers(str);

            Assert.AreEqual(expected, actual, "Does not converge");
        }
        public void InputStringWithLastSameValue()
        {
            string        str           = "aaabcddd";
            int           expected      = 4;
            MaxCharacters maxCharacters = new MaxCharacters();
            int           actual        = maxCharacters.GetMaxCountDifferentCharacters(str);

            Assert.AreEqual(expected, actual, "Does not converge");
        }
        public void InputStringLettersWithLastSameValue()
        {
            string        str           = "abcddd";
            int           expected      = 3;
            MaxCharacters maxCharacters = new MaxCharacters();
            int           actual        = maxCharacters.GetMaxCountSameLatinLetters(str);

            Assert.AreEqual(expected, actual, "Does not converge");
        }