/// <summary> /// Compare the strings when the input field text is changed by the user /// </summary> /// <param name="given"></param> public void CompareStrings(string top, string bottom) { bool match = PermutationCheck.IsPermutation(top, bottom); if (match) { resultText.text = ifMatch; } else { resultText.text = ifNoMatch; } }
public void PermutationCheckSolutionTest() { var permCheck = new PermutationCheck(); int[] array = new int[] { 4, 1, 3, 2 }; int result = permCheck.Solve(array); Assert.AreEqual(1, result); array = new int[] { 4, 1, 3 }; result = permCheck.Solve(array); Assert.AreEqual(0, result); }