Пример #1
0
        public void Test_AreAnagrams_InputWithEqualLengthAndCharacters_ExpectedTrue()
        {
            var anagram = new Anagrams();
            var result  = anagram.AreAnagrams("Debit card", "Bad credit");

            Assert.IsTrue(result);
        }
Пример #2
0
        public void Test_AreAnagrams_InputWithDifferentLength_ExpectedFalse()
        {
            var anagram = new Anagrams();
            var result  = anagram.AreAnagrams("Debit car", "Bad credit");

            Assert.IsFalse(result);
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;

            var ans = Anagrams.GroupAnagrams(new[] { "ток", "рост", "кот", "торс", "Кто", "фывап", "рок" });

            foreach (var strArr in ans)
            {
                Console.WriteLine(string.Join(" ", strArr));
            }
        }
Пример #4
0
        public void Test_Reverse_InputEmptyOrNullStringSecondParam_ExpectedYourEntryIsInvalid()
        {
            var anagram = new Anagrams();

            string[] tests = { string.Empty, null };

            foreach (var test in tests)
            {
                var result = anagram.AreAnagrams("Bad credit", test);
                Assert.IsFalse(result);
            }
        }