public void SortTest() { BubbleSortV1 target = new BubbleSortV1(); int[] list = {1, 2, 6, 5, 4, 7}; int[] expected = { 1, 2, 4, 5, 6, 7 }; int[] actual; actual = target.Sort(list); Assert.AreEqual<string>(expected.ToString(), actual.ToString()); }
public void ArrayWithIntegers_Sort_ReturnsSortedIntegers() { //Arrange var values = new int[] { 2, 4, 1, 8, 9, 3 }; var expectedValues = new int[] { 1, 2, 3, 4, 8, 9 }; var bubbleSort = new BubbleSortV1(); //Act var actualValues = bubbleSort.Sort(values); //Assert for (var i = 0; i < values.Length; i++) { Assert.AreEqual(expectedValues[i], actualValues[i]); } }