Exemplo n.º 1
0
        public void TestZeroLen()
        {
            SortColors sc = new SortColors();

            int[] nums = new int[0];
            sc.SortCol(nums);

            Assert.AreEqual(0, nums.Length);
        }
Exemplo n.º 2
0
        public void Testnull()
        {
            SortColors sc = new SortColors();

            int[] nums = null;

            sc.SortCol(nums);

            Assert.AreEqual(null, nums);
        }
Exemplo n.º 3
0
        public void TestFunction()
        {
            SortColors sc = new SortColors();

            int[] nums = new int[6] {
                2, 0, 2, 1, 1, 0
            };

            sc.SortCol(nums);

            int[] expected = new int[6] {
                0, 0, 1, 1, 2, 2
            };
            Assert.AreEqual(expected.Length, nums.Length);
            for (int i = 0; i < nums.Length; i++)
            {
                Assert.AreEqual(expected[i], nums[i]);
            }
        }