public void MergeSort_Test2() { int[] array = null; int[] expected = null; SortClass sortClass = new SortClass(); array = sortClass.MergeSort(array); CollectionAssert.AreEqual(expected, array); }
public void MergeSort_Test3() { int[] array = new int[] { 5, 4, 3, 2, 1 }; int[] expected = new int[] { 1, 2, 3, 4, 5 }; SortClass sortClass = new SortClass(); array = sortClass.MergeSort(array); CollectionAssert.AreEqual(expected, array); }
public void MergeSort_Test1() { int[] array = new int[] { 6, 4, 8, 2, 9, 1 }; int[] expected = new int[] { 1, 2, 4, 6, 8, 9 }; SortClass sortClass = new SortClass(); array = sortClass.MergeSort(array); CollectionAssert.AreEqual(expected, array); }
public void MergeSort_IntMaxAndMinValueAndZeroTest() { int[] massive = { 0, int.MaxValue, int.MinValue }; int[] sortedMassive = { int.MinValue, 0, int.MaxValue }; var mergeSortResult = SortClass.MergeSort(massive); for (int i = 0; i < mergeSortResult.Length; i++) { Assert.AreEqual(mergeSortResult[i], sortedMassive[i]); } }
public void MergeSort_NegativeNumbersTest() { int[] massive = { -23, -48, -34, -9, -4 }; int[] sortedMassive = { -48, -34, -23, -9, -4 }; var mergeSortResult = SortClass.MergeSort(massive); for (int i = 0; i < mergeSortResult.Length; i++) { Assert.AreEqual(mergeSortResult[i], sortedMassive[i]); } }
public void MergeSort_PositiveNumbersTest() { int[] massive = { 5, 3, 7, 9, 1 }; int[] sortedMassive = { 1, 3, 5, 7, 9 }; var mergeSortResult = SortClass.MergeSort(massive); for (int i = 0; i < mergeSortResult.Length; i++) { Assert.AreEqual(mergeSortResult[i], sortedMassive[i]); } }
public void MergeSort_NullArray() { SortClass.MergeSort(null); }