Exemplo n.º 1
0
        public void Return_OneNumSorted()
        {
            SortedArray obj = new SortedArray();

            int[] oneNumSorted = new int[] { 7 };
            obj.SortNumbers(oneNumSorted);
            var sortedArray = obj.SortNumbers(oneNumSorted);

            Assert.AreEqual(oneNumSorted[0], sortedArray[0]);
        }
Exemplo n.º 2
0
        public void return_threeNumSorted()
        {
            SortedArray obj3 = new SortedArray();

            int[] threeNumArray = new int[3] {
                2, 1, 3
            };
            obj3.SortNumbers(threeNumArray);
            int[] sortedArray = new int[3] {
                1, 2, 3
            };
            Assert.AreEqual(threeNumArray[0], sortedArray[0]);
        }
Exemplo n.º 3
0
        public void return_tenNumSorted()
        {
            SortedArray obj10 = new SortedArray();

            int[] tenArray = new int[10] {
                101, 7, 89, 1000, 23, 33, 10201, 1, 99, -10
            };
            int[] sortedArray = obj10.SortNumbers(tenArray);
            int[] checkArray  = new int[10] {
                -10, 1, 7, 23, 33, 89, 99, 101, 1000, 10201
            };
            Assert.AreEqual(tenArray[0], checkArray[0]);
        }
Exemplo n.º 4
0
        public void return_twoNumSorted()
        {
            SortedArray obj = new SortedArray();

            int[] TwoNumSorted = new int[2] {
                7, 1
            };
            obj.SortNumbers(TwoNumSorted);
            int[] sortedArray = obj.SortNumbers(TwoNumSorted);
            int[] checkArray  = new int[2] {
                1, 7
            };
            Assert.AreEqual(TwoNumSorted[0], checkArray[0]);
        }