Example #1
0
        public void MyTestMethod6()
        {
            bool actual = false;

            int[] xamp = { 45, 23, 11, 89, 77, 98, 4, 28, 65, 43 };
            var   test = new merge_sort <int>();

            int[] expected = { 4, 11, 23, 28, 43, 45, 65, 77, 89, 98 };
            test.sort(xamp);
            int j = 0;

            for (int i = 0; i < xamp.Length; i++)
            {
                if (expected[i] == xamp[i])
                {
                    j++;
                }
            }
            if (j == xamp.Length)
            {
                actual = true;
            }
            bool ret = true;

            Assert.AreEqual(ret, actual);
        }
Example #2
0
        public void MyTestMethod7()
        {
            bool actual = false;

            bool[] xamp = { true, false, false, true, true, false, false, true, true };
            var    test = new merge_sort <bool>();

            bool[] expected = { false, false, false, false, true, true, true, true, true, };
            test.sort(xamp);
            int j = 0;

            for (int i = 0; i < xamp.Length; i++)
            {
                if (expected[i] == xamp[i])
                {
                    j++;
                }
            }
            if (j == xamp.Length)
            {
                actual = true;
            }
            bool ret = true;

            Assert.AreEqual(ret, actual);
        }
Example #3
0
        public void MyTestMethod5()
        {
            bool actual = false;

            string[] xamp = { "afd", "abe", "adf", "cdf", "bad", "fad" };
            var      test = new merge_sort <string>();

            string[] expected = { "abe", "adf", "afd", "bad", "cdf", "fad" };
            test.sort(xamp);
            int j = 0;

            for (int i = 0; i < xamp.Length; i++)
            {
                if (expected[i] == xamp[i])
                {
                    j++;
                }
            }
            if (j == xamp.Length)
            {
                actual = true;
            }
            bool ret = true;

            Assert.AreEqual(ret, actual);
        }