Пример #1
0
        public void Test_CharsCounter_AllCharsUnique()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal(true, ch1.CharsCounter_AllCharsUnique("aAbBcCdD"));
            Assert.Equal(false, ch1.CharsCounter_AllCharsUnique("aAbBcCdDaAbBcCdD"));
        }
Пример #2
0
        public void Test_CheckReversalStrings()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal(true, ch1.CheckReversalStrings("abcde", "edcba"));
            Assert.Equal(false, ch1.CheckReversalStrings("abcde", "edcab"));
        }
Пример #3
0
        public void Test_CharsCounter_Sort()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal("abcd".ToCharArray(), ch1.Sort("bcda"));
            Assert.Equal("ABCDabcd".ToCharArray(), ch1.Sort("aBcDAbCd"));
        }
Пример #4
0
        public void Test_CheckOneModification()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal(true, ch1.CheckOneModification("pale", "ple"));
            Assert.Equal(true, ch1.CheckOneModification("pales", "pale"));
            Assert.Equal(true, ch1.CheckOneModification("pale", "bale"));
            Assert.Equal(false, ch1.CheckOneModification("pale", "bake"));
        }
Пример #5
0
        public void Test_CheckPalindrome()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal(true, ch1.CheckPalindrome("tact coa", "tact coa"));
            Assert.Equal(true, ch1.CheckPalindrome("tact coa", "taco cat"));
            Assert.Equal(true, ch1.CheckPalindrome("tact coa", "atco cta"));
            Assert.Equal(false, ch1.CheckPalindrome("tact coa", "atco ctc"));
            Assert.Equal(false, ch1.CheckPalindrome("tact coa", "tactcoa"));
        }
Пример #6
0
        public void Test_ReplaceBlanks()
        {
            var ch1 = new Chapter1ArraysAndStrings();

            Assert.Equal("Mr\rJohn\rSmith", ch1.ReplaceBlanks("Mr John   Smith   ", (char)13));
        }