Beispiel #1
0
        public void RemoveTodoItemStateHandlesUnknownTodoListIDs()
        {
            ILog      mockLog      = Substitute.For <ILog>();
            IConsole  mockConsole  = Substitute.For <IConsole>();
            ITodoList mockTodoList = Substitute.For <ITodoList>();

            mockConsole.GetInput().Returns("0");
            mockTodoList.When(todoList => todoList.RemoveEntry(Arg.Any <UInt32>())).Do(x => { throw new ArgumentOutOfRangeException(); });

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

            state.Execute();

            mockConsole.Received(1).OutputLine("Item with given ID not found");
        }