Beispiel #1
0
            public void TaskReactivatedEvent()
            {
                var taskId = Guid.NewGuid();
                var e      = new TaskReactivatedEvent()
                {
                    TaskId = taskId
                };
                var task = OTask.Factory.Create(taskId, "Fake");

                task.ApplyEvent(e);
                Assert.Null(task.DateOfCancellation);
                Assert.Null(task.DateOfCompletion);
            }
Beispiel #2
0
        public void Reactivate()
        {
            if (!this.DateOfCancellation.HasValue && !this.DateOfCompletion.HasValue)
            {
                throw new InvalidOperationException("Can't reactivate an already active task.");
            }
            var e = new TaskReactivatedEvent()
            {
                TaskId = this.Id
            };

            RaiseEvent(e);
        }
Beispiel #3
0
 public void ApplyEvent(TaskReactivatedEvent @event)
 {
     this.DateOfCancellation = null;
     this.DateOfCompletion   = null;
 }