public void Question_1_2_Basic_ReturnsTrue() { var s1 = "abc"; var s2 = "cba"; Assert.AreEqual(true, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(true, Question_1_2.AreStringsPermutationsSort(s1, s2)); }
public void Question_1_2_BasicSize_ReturnsFalse() { var s1 = "abc"; var s2 = "cb"; Assert.AreEqual(false, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(false, Question_1_2.AreStringsPermutationsSort(s1, s2)); }
public void Question_1_2_EdgeCases_ReturnsFalse() { var s1 = (string)null; var s2 = string.Empty; Assert.AreEqual(false, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(false, Question_1_2.AreStringsPermutationsSort(s1, s2)); }
public void CheckPermutationTest_ReturnFalse(string str1, string str2) { bool result = Question_1_2.CheckPermutationInplaceSort(str1, str2); Assert.IsFalse(result, $"{str1} and {str2} are permutations of each other - in-place sort."); result = Question_1_2.CheckPermutationHashTable(str1, str2); Assert.IsFalse(result, $"{str1} and {str2} are permutations of each other - hash table."); }
public void Question_1_2_EdgeCases_ReturnsTrue() { var s1 = (string)null; var s2 = (string)null; Assert.AreEqual(true, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(true, Question_1_2.AreStringsPermutationsSort(s1, s2)); s1 = string.Empty; s2 = string.Empty; Assert.AreEqual(true, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(true, Question_1_2.AreStringsPermutationsSort(s1, s2)); s1 = "a"; s2 = "a"; Assert.AreEqual(true, Question_1_2.AreStringsPermutationsDict(s1, s2)); Assert.AreEqual(true, Question_1_2.AreStringsPermutationsSort(s1, s2)); }