public void Test_AreAnagrams_InputWithEqualLengthAndCharacters_ExpectedTrue() { var anagram = new Anagrams(); var result = anagram.AreAnagrams("Debit card", "Bad credit"); Assert.IsTrue(result); }
public void Test_AreAnagrams_InputWithDifferentLength_ExpectedFalse() { var anagram = new Anagrams(); var result = anagram.AreAnagrams("Debit car", "Bad credit"); Assert.IsFalse(result); }
static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; var ans = Anagrams.GroupAnagrams(new[] { "ток", "рост", "кот", "торс", "Кто", "фывап", "рок" }); foreach (var strArr in ans) { Console.WriteLine(string.Join(" ", strArr)); } }
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); } }