public void CommandTodoStateReturnsReadTodoState() { ILog mockLog = Substitute.For<ILog>(); IConsole mockConsole = Substitute.For<IConsole>(); ITodoList mockTodoList = Substitute.For<ITodoList>(); CommandTodoState state = new CommandTodoState(mockConsole, mockLog, mockTodoList); Assert.IsInstanceOfType(state.GetNextState(), typeof(ReadTodoState)); }
public void CommandTodoStateHandlesUnknownCommandStrings() { ILog mockLog = Substitute.For<ILog>(); IConsole mockConsole = Substitute.For<IConsole>(); ITodoList mockTodoList = Substitute.For<ITodoList>(); CommandTodoState state = new CommandTodoState(mockConsole, mockLog, mockTodoList); state.Input = "UNKNOWN COMMAND"; state.Execute(); mockConsole.Received(1).OutputLine("Unrecognised command. Please enter one of the following commands"); mockConsole.Received(1).OutputLine("Remove todo list entry"); mockConsole.Received(1).OutputLine("Display help"); Assert.IsInstanceOfType(state.GetNextState(), typeof(ReadTodoState)); }