public void When_completing_a_missing_task()
        {
            _exception = Catch.Exception(() => _handler.Handle(_cmd));

            //_should_fail
            Assert.IsInstanceOf <ArgumentOutOfRangeException>(_exception);
            //_should_not_post_event
            A.CallTo(() => _commandProcessor.Post(A <TaskCompletedEvent> ._)).MustNotHaveHappened();
        }
Ejemplo n.º 2
0
        public void When_completing_an_existing_task()
        {
            _handler.Handle(_cmd);
            _taskToBeCompleted = _tasksDAO.FindById(_cmd.TaskId);

            //_should_update_the_tasks_completed_date
            Assert.AreEqual(s_COMPLETION_DATE.Date, _taskToBeCompleted.CompletionDate.Value.Date);
            //_should_post_event
            A.CallTo(() => s_commandProcessor.Post(A <TaskCompletedEvent> ._)).MustHaveHappened(Repeated.Exactly.Once);
        }