public void IsPermutation_Normally_IsCommutative() {
            var input1 = "AABCDE";
            var input2 = "EADBCA";
            var p = new Permutation();

            var actualResult = p.IsPermutationOfEachOther(input2, input1) == p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = true;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 2
0
        public void IsPermutation_Normally_IsCommutative()
        {
            var input1 = "AABCDE";
            var input2 = "EADBCA";
            var p      = new Permutation();

            var actualResult   = p.IsPermutationOfEachOther(input2, input1) == p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = true;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 3
0
        public void IsPermutation_Normally_IsCaseSensitive(string input1, string input2, bool expectedResult)
        {
            var p            = new Permutation();
            var actualResult = p.IsPermutationOfEachOther(input1, input2);

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void IsPermutation_GivenOneEmptyAndOneNonEmptyString_ReturnsFalse(string inputA, string inputB) {
            var p = new Permutation();

            var actualResult = p.IsPermutationOfEachOther(inputA, inputB);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 5
0
        public void IsPermutation_GivenOneEmptyAndOneNonEmptyString_ReturnsFalse(string inputA, string inputB)
        {
            var p = new Permutation();

            var actualResult   = p.IsPermutationOfEachOther(inputA, inputB);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void IsPermutation_StringLengthsDiffer_ReturnsFalse() {
            var input1 = "AABCD";
            var input2 = "AABCDE";
            var p = new Permutation();

            var actualResult = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void IsPermutation_GivenTwoEmptyStrings_ReturnsTrue() {
            var input1 = String.Empty;
            var input2 = String.Empty;
            var p = new Permutation();

            var actualResult = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = true;

            Assert.AreEqual(expectedResult, actualResult);
        }
        public void IsPermutation_GivenANonPermutedCouple_ReturnsFalse() {
            var input1 = "AABCDE";
            var input2 = "EEDBCA";
            var p = new Permutation();

            var actualResult = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 9
0
        public void IsPermutation_StringLengthsDiffer_ReturnsFalse()
        {
            var input1 = "AABCD";
            var input2 = "AABCDE";
            var p      = new Permutation();

            var actualResult   = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 10
0
        public void IsPermutation_GivenTwoEmptyStrings_ReturnsTrue()
        {
            var input1 = String.Empty;
            var input2 = String.Empty;
            var p      = new Permutation();

            var actualResult   = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = true;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 11
0
        public void IsPermutation_GivenANonPermutedCouple_ReturnsFalse()
        {
            var input1 = "AABCDE";
            var input2 = "EEDBCA";
            var p      = new Permutation();

            var actualResult   = p.IsPermutationOfEachOther(input1, input2);
            var expectedResult = false;

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 12
0
 public void IsPermutation_GivenNullsInAnyPosition_ThrowsNullArgumentException(string inputA, string inputB)
 {
     var p = new Permutation();
     Assert.Throws<ArgumentNullException>(()=> p.IsPermutationOfEachOther(inputA, inputB));
 }
Esempio n. 13
0
 public void IsPermutation_Normally_IsCaseSensitive(string input1,string input2, bool expectedResult) {
     var p = new Permutation();
     var actualResult = p.IsPermutationOfEachOther(input1, input2);
     Assert.AreEqual(expectedResult, actualResult);
 }
Esempio n. 14
0
        public void IsPermutation_GivenNullsInAnyPosition_ThrowsNullArgumentException(string inputA, string inputB)
        {
            var p = new Permutation();

            Assert.Throws <ArgumentNullException>(() => p.IsPermutationOfEachOther(inputA, inputB));
        }