Example #1
0
        public void ZeroElements()
        {
            int[] A      = { };
            int   result = PermChecker.IsPermutation(A);

            Assert.AreEqual(result, 0);
        }
Example #2
0
        public void RepeatedElements()
        {
            int[] A      = { 10, 9, 8, 7, 7, 6, 5, 4, 3, 2, 1 };
            int   result = PermChecker.IsPermutation(A);

            Assert.AreEqual(result, 0);
        }
Example #3
0
        public void DoesNotStartWithOne()
        {
            int[] A      = { 3, 2 };
            int   result = PermChecker.IsPermutation(A);

            Assert.AreEqual(result, 0);
        }
Example #4
0
        public void OneElement()
        {
            int[] A      = { 1 };
            int   result = PermChecker.IsPermutation(A);

            Assert.AreEqual(result, 1);
            int[] B = { 2 };
            result = PermChecker.IsPermutation(B);
            Assert.AreEqual(result, 0);
        }
Example #5
0
 public PermCheckerTests()
 {
     _sut = new PermChecker();
 }