public void JaggedArraySortByMinElementsInRowsNullTest() { int[][] data = null; JaggedArray jaggedArray = new JaggedArray(data); Assert.Throws <ArgumentNullException>(() => jaggedArray.SortRowsByMinElementsInRows(true)); }
public void JaggedArraySortByMinElementsInRowsTest5() { int[][] data = { new int[7] { 4, 5, 6, -13, -22, 33, -17 }, new int[7] { 4, 5, 6, -13, -22, 33, -17 }, new int[7] { 4, 5, 6, -13, -22, 33, -17 } }; JaggedArray jaggedArray = new JaggedArray(data); int[][] expected = { new int[7] { 4, 5, 6, -13, -22, 33, -17 }, new int[7] { 4, 5, 6, -13, -22, 33, -17 }, new int[7] { 4, 5, 6, -13, -22, 33, -17 } }; int[][] actual = jaggedArray.SortRowsByMinElementsInRows(true); Assert.AreEqual(expected, actual); }
public void JaggedArraySortByMinElementsInRowsTest2() { int[][] data = { new int[4] { 4, 5, 6, 11 }, new int[2] { 7, 9 }, new int[3] { 1, 2, 6 } }; JaggedArray jaggedArray = new JaggedArray(data); int[][] expected = { new int[2] { 7, 9 }, new int[4] { 4, 5, 6, 11 }, new int[3] { 1, 2, 6 } }; int[][] actual = jaggedArray.SortRowsByMinElementsInRows(false); Assert.AreEqual(expected, actual); }
public void JaggedArraySortByMinElementsInRowsRowNullTest() { int[][] data = { null, new int[1] { 17 }, new int[3] { 19, 22, 33 } }; JaggedArray jaggedArray = new JaggedArray(data); Assert.Throws <ArgumentNullException>(() => jaggedArray.SortRowsByMinElementsInRows(false)); }
public void JaggedArraySortByMinElementsInRowsTest4() { int[][] data = { new int[1] { 5 }, new int[5] { 7, 9, 0, 5, 1 }, new int[6] { 1, 2, 6, 1, -1, 3 }, new int[6] { 4, 5, 6, 11, 18, -11 }, new int[2] { -19, 22 }, new int[4] { 100, 100, -150, 88 } }; JaggedArray jaggedArray = new JaggedArray(data); int[][] expected = { new int[1] { 5 }, new int[5] { 7, 9, 0, 5, 1 }, new int[6] { 1, 2, 6, 1, -1, 3 }, new int[6] { 4, 5, 6, 11, 18, -11 }, new int[2] { -19, 22 }, new int[4] { 100, 100, -150, 88 } }; int[][] actual = jaggedArray.SortRowsByMinElementsInRows(false); Assert.AreEqual(expected, actual); }
public void JaggedArraySortByMinElementsInRowsTest6() { int[][] data = { new int[5] { 0, 0, 0, 0, 0 }, new int[3] { 0, 0, 0 }, new int[5] { 0, 0, 0, 0, 0 }, new int[2] { 0, 0 }, new int[5] { 0, 0, 0, 0, 0 } }; JaggedArray jaggedArray = new JaggedArray(data); int[][] expected = { new int[5] { 0, 0, 0, 0, 0 }, new int[3] { 0, 0, 0 }, new int[5] { 0, 0, 0, 0, 0 }, new int[2] { 0, 0 }, new int[5] { 0, 0, 0, 0, 0 } }; int[][] actual = jaggedArray.SortRowsByMinElementsInRows(false); Assert.AreEqual(expected, actual); }