예제 #1
0
        public void SimpleArrayTest()
        {
            int[] nums = new int[] { 1, 0, 2, 0, 3, 0 };

            ArrayProgram.MoveZeroes(nums);

            CollectionAssert.AreEqual(new int[] { 1, 2, 3, 0, 0, 0 }, nums);
        }
예제 #2
0
        public void ComplexArrayTest()
        {
            int[] nums = new int[] { 0, 0, 0, 1, 0, 0, 2, 0, 3, 5, 67, 4, 5, 6, 0, 3, 4, 3, 6, 7 };

            ArrayProgram.MoveZeroes(nums);

            CollectionAssert.AreEqual(new int[] { 1, 2, 3, 5, 67, 4, 5, 6, 3, 4, 3, 6, 7, 0, 0, 0, 0, 0, 0, 0 }, nums);
        }
예제 #3
0
        public void EmptyArrayTest()
        {
            int[] nums = new int[] { };

            ArrayProgram.MoveZeroes(nums);

            CollectionAssert.AreEqual(new int[] { }, nums);
        }