public void FirstPage_GivenCsvUserCommandsWhenFirstPageIsCalled_BrowsableReturnsNextPage() { var browsable = Substitute.For<Browsable>(); var display = Substitute.For<Display>(); var sut = new CsvUserCommands(display, browsable); sut.FirstPage(); browsable.Received(1).NextPage(); }
public void FirstPage_GivenCsvUserCommandsWhenFirstPageIsCalled_DisplayShowsAPageAndPrintsUserOptions() { var browsable = Substitute.For<Browsable>(); var display = Substitute.For<Display>(); var sut = new CsvUserCommands(display, browsable); sut.FirstPage(); display.Received(1).Show(Arg.Any<Page>()); display.Received(1).PrintUserOptionsFor(Arg.Any<int>()); }
public static void Main(string[] args) { List<DataRecord> dataRecords = new CsvFileConverter().ToDataRecords(args[FILE_NAME]); var userCommands = new CsvUserCommands( new ConsoleDisplay(), new Table( dataRecords, defaultPageSize: new PageSizeAgent( defaultPageSize: 3, indexOfPageSize: 1).DetectPageSize(args))); var csvViewer = new CsvViewer( new ConsoleUser(user, userCommands), userCommands); csvViewer.Execute(); }
public ConsoleUser(UserCommandReceiverListener user, CsvUserCommands userCommands) { this.user = user; this.userCommands = userCommands; }