public void ShowBooks() { var books = _bookService.GetAll(); _menuVisualizer.ShowCollection(books); _outputEnvironment.Write($"\n{Resource.ChooseSomeone}: "); var choice = _outputEnvironment.ReadInt(1, books.Count); ShowDetails(books[choice - 1]); }
/// <summary> /// Showing clients list /// </summary> public void ShowClients() { var clients = _clientService.GetAll(); _menuVisualizer.ShowCollection(clients); _outputEnvironment.Write($"{Resource.ChooseSomeone}: "); var choice = _outputEnvironment.ReadInt(1, clients.Count); ShowDetails(clients[choice - 1]); }
public void DisplayMenu_WhenDisplayMenu_ThenInvokeInvokeReadChoice() { // Arrange _menu.Add(" ", () => { }); A.CallTo(() => _outputEnvironment.ReadInt(A <int> ._, A <int> ._)) .Returns(1); // Act _menu.Display(); // Act - Assert A.CallTo(() => _outputEnvironment.ReadInt(A <int> ._, A <int> ._)).MustHaveHappened(); }
public void Setup() { this._logger = A.Fake <ICustomLoggerFactory>(); this._menuVisualizer = A.Fake <IMenuVisualizer>(); this._outputEnvironment = A.Fake <IOutputEnvironment>(); this._clientService = A.Fake <IClientService>(); this._bookService = A.Fake <IBookService>(); this._commentService = A.Fake <ICommentService>(); A.CallTo(() => _clientService.GetAll()) .Returns(new List <ClientDto> { new ClientDto { CommentsId = new List <Guid> { Guid.NewGuid() }, WishedBooksId = new List <Guid> { Guid.NewGuid() } } }); A.CallTo(() => _outputEnvironment.ReadInt(A <int> ._, A <int> ._)).Returns(1); _page = new ClientPage( _logger, _menuVisualizer, _outputEnvironment, _clientService, _bookService, _commentService); }