Esempio n. 1
0
        public void Test3()
        {
            int expected = 0;

            int[] input  = new int[] { 2, 4 };
            var   actual = Class20.ClosestElement(input, 3);

            Assert.Equal(expected, actual);
        }
Esempio n. 2
0
        public void Test4()
        {
            int expected = -1;

            int[] input  = null;
            var   actual = Class20.ClosestElement(input, 3);

            Assert.Equal(expected, actual);
        }
Esempio n. 3
0
        public void Test1()
        {
            int expected = 3;

            int[] input  = new int[] { 1, 2, 4, 5, 7, 8, 9 };
            var   actual = Class20.ClosestElement(input, 6);

            Assert.Equal(expected, actual);
        }