Beispiel #1
0
        public void DisplayTodoHeaderStateOutputsAllTodoItems()
        {
            TodoEntry        todoEntry   = new TodoEntry("entry");
            List <TodoEntry> todoEntries = new List <TodoEntry>()
            {
                todoEntry
            };

            IConsole  mockConsole  = Substitute.For <IConsole>();
            ILog      mockLog      = Substitute.For <ILog>();
            ITodoList mockTodoList = Substitute.For <ITodoList>();

            mockTodoList.GetEntries().Returns(todoEntries);

            DisplayTodoListHeaderState state = new DisplayTodoListHeaderState(mockConsole, mockLog, mockTodoList);

            state.Execute();

            mockConsole.Received(1).Output("0> ");
            mockConsole.Received(1).OutputLine("entry");
        }