Ejemplo n.º 1
0
 public void TestZeroElements()
 {
     Solution instance = new Solution();
     int[] array = new int[] { };
     int result = instance.solution(array);
     Assert.AreEqual(result, 0);
 }
Ejemplo n.º 2
0
 public void TestGreatNumberElements()
 {
     Solution instance = new Solution();
     int[] array = new int[] {2323232 };
     int result = instance.solution(array);
     Assert.AreEqual(result, -1);
 }
Ejemplo n.º 3
0
        public void TestOutOfRange()
        {
            Solution instance = new Solution();
            int[] A = new int[2] {3434, 2323};

            int P = instance.solution(A);
            Assert.AreEqual(P, -1);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, 3);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, 7);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, -1);
        }
Ejemplo n.º 4
0
        public void TestBigNumberElements()
        {
            Solution instance = new Solution();
            int[] A = new int[3] { 2147483647, 3, 2147483647};

            int P = instance.solution(A);
            Assert.AreEqual(P, 1);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, 3);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, 7);
            //int P = instance.solution(A);
            //Assert.AreEqual(P, -1);
        }
Ejemplo n.º 5
0
 public void Test8Elements()
 {
     Solution instance = new Solution();
     int[] A = new int[8];
     A[0] = -1;
     A[1] = 3;
     A[2] = -4;
     A[3] = 5;
     A[4] = 1;
     A[5] = -6;
     A[6] = 2;
     A[7] = 1;
     int P = instance.solution(A);
     Assert.AreEqual(P, 1);
     //int P = instance.solution(A);
     //Assert.AreEqual(P, 3);
     //int P = instance.solution(A);
     //Assert.AreEqual(P, 7);
     //int P = instance.solution(A);
     //Assert.AreEqual(P, -1);
 }