Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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.");
        }
Пример #5
0
        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));
        }