Example #1
0
    public void ShouldSortReversedOrder()

    {
        int[] array = new int[] { 8, 7, 6, 5, 4, 3, 2, 1 };



        var bubble = new BubbleSort1(array);

        bubble.Sort();



        Assert.That(bubble.Array, Is.EqualTo(expected));
    }
Example #2
0
    public void ShouldSortIncreasingOrder()

    {
        int[] array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };



        var bubble = new BubbleSort1(array);

        bubble.Sort();



        Assert.That(bubble.Array, Is.EqualTo(expected));
    }
Example #3
0
    public void ShouldSortDefaultOrder()

    {
        int[] array = new int[] { 1, 8, 5, 4, 3, 2, 7, 6 };



        var bubble = new BubbleSort1(array);

        bubble.Sort();



        Assert.That(bubble.Array, Is.EqualTo(expected));
    }
 public void TestSortJuggedArrayWithInterfaceThrows1(int[][] arr, Comparer <int[]> comparator)
 {
     Assert.That(() => BubbleSort1.SortJuggedArray(arr, comparator), Throws.TypeOf <ArgumentNullException>());
 }
 public int[][] TestSortJuggedArrayWithInterface1(int[][] arr, IComparer <int[]> comparator)
 {
     BubbleSort1.SortJuggedArray(arr, comparator);
     return(arr);
 }
 public void TestSortJuggedArrayWithDelegateThrows1(int[][] arr, Compare compare)
 {
     Assert.That(() => BubbleSort1.SortJuggedArray(arr, compare), Throws.TypeOf <ArgumentNullException>());
 }
 public int[][] TestSortJuggedArrayWithDelegate1(int[][] arr, IComparer <int[]> comparator)
 {
     BubbleSort1.SortJuggedArray(arr, comparator.Compare);
     return(arr);
 }