예제 #1
0
        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));
            }
        }
예제 #2
0
        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);
        }