public void Run() { var item = new InsertionSortTrace(); var consoleReaderListOfNumbers = new ConsoleReaderListOfNumbers(); var trace = item.TraceSort(consoleReaderListOfNumbers.GetNumbers()); foreach (var traceItem in trace) { Console.WriteLine(string.Join(" ", traceItem)); } }
public void ShouldTraceInsertionSort(string almostSortedList, string expectedTrace) { var expected = ParseListOfArrays(expectedTrace); var sut = new InsertionSortTrace(); //Act var actual = sut.TraceSort(ParseListOfNumbers(almostSortedList)); //Assert Assert.AreEqual(expected, actual); }