示例#1
0
        static void Main()
        {
            numArray = new int[] { 2, 4, 6, 8, 2, 4, 3, 2, 4, 6, 7, 9, 7, 5, 4, 2, 2 };

            CheckCounter.ShowArray(numArray);
            FindFirstBiggerThanNeighbours();

            Console.WriteLine("The first number  bigger than it's neighbours is with index: {0}.", index);
        }
示例#2
0
        static void Main()
        {
            numArray = new int[] { 2, 4, 6, 8, 2, 4, 3, 2, 4, 6, 7, 9, 7, 5, 4, 2, 2 };

            CheckCounter.ShowArray(numArray);

            CheckPosition();

            Console.WriteLine("The number at position {0} is bigger than it's neighbours? -> {1}", position, CheckIndex());
        }
示例#3
0
        public void TestWithMaxValue()
        {
            //data to check
            decimal[] array = { 17, 5212, 17, 5212, maxValue, maxValue, maxValue, 0 };

            //add test data
            CheckCounter.CountElements = maxValue;
            CheckCounter.CountElements(numArray);

            //assert
            Assert.AreEqual(3, CheckCounter.CountElements.counter);
        }
示例#4
0
        public void TestMethod1()
        {
            //data to check
            decimal[] array = { maxValue, minValue, minValue, maxValue };

            //add test data
            CheckCounter.CountElements = minValue;
            CheckCounter.CountElements(numArray);


            //assert
            Assert.AreEqual(2, CheckCounter.CountElements.counter);


            //we  null the counter in order to reset the counter in the original class, because it's static and currently set to 2.
            CheckCounter.CountElements.counter = 0;
        }