예제 #1
0
        public void DoesNotConvertNumberWithTwoSignsReversed()
        {
            const string testWord = "-+10000";

            Assert.Throws <InvalidOperationException>(() => StringFiltering.ConvertToInt(testWord));
        }
예제 #2
0
        public void GeneratePalindromesGeneratesPalindromePartitionsOfString()
        {
            const string testWord = "aabaac";

            Assert.Equal(new[] { "a", "a", "b", "a", "a", "c", "aa", "aa", "aba", "aabaa" }, StringFiltering.GeneratePalindromes(testWord));
        }
예제 #3
0
 public void GeneratePalindromesThrowsNullStringException()
 {
     Assert.Throws <ArgumentNullException>(() => StringFiltering.GeneratePalindromes(null));
 }
예제 #4
0
        public void DoesNotConvertNumberWithLetters()
        {
            const string testWord = "10000b";

            Assert.Throws <InvalidOperationException>(() => StringFiltering.ConvertToInt(testWord));
        }
예제 #5
0
        public void CheckVowelsAndConsonantsNumber()
        {
            const string testWord = "abcdef";

            Assert.Equal((2, 4), StringFiltering.CountVowelsAndConsonants(testWord));
        }
예제 #6
0
        public void ConvertsNumberWithWhitespacesAndSign()
        {
            const string testWord = "+10 0 0 0";

            Assert.Equal(10000, StringFiltering.ConvertToInt(testWord));
        }
예제 #7
0
        public void ConvertsNumberWithSign()
        {
            const string testWord = "-10 000";

            Assert.Equal(-10000, StringFiltering.ConvertToInt(testWord));
        }
예제 #8
0
        public void CheckMostOccurenciesCharInString()
        {
            const string testWord = "cbeabcca";

            Assert.Equal('c', StringFiltering.FindCharacterWithMostOccurences(testWord));
        }
예제 #9
0
        public void CheckFirstUniqueCharcaterInStringWithOnlyUniqueCharacters()
        {
            const string testWord = "cbae";

            Assert.Equal('c', StringFiltering.FindFirstUniqueCharacter(testWord));
        }
예제 #10
0
        public void CheckFirstUniqueCharcaterInString()
        {
            const string testWord = "cbabcea";

            Assert.Equal('e', StringFiltering.FindFirstUniqueCharacter(testWord));
        }