示例#1
0
 public void Test1()
 {
     int[] a        = new int[] { 5, 4, 3, 2, 1 };
     int[] expected = new int[] { 1, 2, 3, 4, 5 };
     int[] actual   = MyBubbleSort.BubbleSortSolution(a);
     Assert.Equal(expected, actual);
 }
示例#2
0
        public void TestMethod1()
        {
            int[] myArray = { 4, 5, 20, 78, 7, 1 };
            MyBubbleSort.BubbleSort(myArray);

            Assert.AreEqual(1, myArray[0]);
            Assert.AreEqual(4, myArray[1]);
            Assert.AreEqual(5, myArray[2]);
            Assert.AreEqual(7, myArray[3]);
            Assert.AreEqual(20, myArray[4]);
            Assert.AreEqual(78, myArray[5]);
        }