예제 #1
0
        public void TestMethod_ForArraySorting()
        {
            int[]        arr1         = { 1, 3, 4, 6, 8 };
            int[]        arr2         = { 2, 5, 7, 9, 10 };
            int[]        arr3         = { };
            int[]        arr4         = { -5, -2, -4, -3, -1, 0 };
            ArraySorting arraySorting = new ArraySorting();

            Assert.IsTrue(IsEqual(arraySorting.SortAndMergeArray(arr1, arr2), new Int32[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }));
            Assert.IsTrue(IsEqual(arraySorting.SortAndMergeArray(arr1, arr3), new Int32[] { 1, 3, 4, 6, 8 }));
            Assert.IsTrue(IsEqual(arraySorting.SortAndMergeArray(arr1, arr4), new Int32[] { -5, -4, -3, -2, -1, 0, 1, 3, 4, 6, 8 }));
        }
예제 #2
0
    public static void Main()
    {
        Console.WriteLine("Hello");
        int[]        arr1         = { 1, 3, 4, 6, 8 };
        int[]        arr2         = { 2, 5, 7, 9, 10 };
        int[]        arr3         = {};
        int[]        arr4         = { -5, -2, -4, -3, -1, 0 };
        Game         game         = new Game();
        ArraySorting arraySorting = new ArraySorting();

        Console.WriteLine(game.MacroPolo(20));

        var sortedArray = arraySorting.SortAndMergeArray(arr1, arr4);

        for (int i = 0; i < sortedArray.Length; i++)
        {
            Console.Write(sortedArray[i]);
        }

        Console.ReadKey();
    }