public void Canceled_event_cannot_be_raised()
        {
            _aggregate.ClearEvents();
            Assert.Throws <ScheduledEventNotFoundException>(() => _aggregate.RaiseScheduledEvent(_futureEventA.Id));
            var anyEvents = _aggregate.GetEvents <DomainEvent>();

            CollectionAssert.IsEmpty(anyEvents);
        }
        public void When_cancel_existing_scheduled_future_event()
        {
            _aggregate = new TestAggregate(Guid.NewGuid());
            var testValue = "value D";

            _aggregate.ScheduleInFuture(DateTime.Now.AddSeconds(400), testValue);
            _futureEvent = _aggregate.GetEvent <FutureEventScheduledEvent>();
            _aggregate.ClearEvents();
            _aggregate.CancelFutureEvents("will not be found in any future event");
        }
        public void When_cancel_existing_scheduled_future_event()
        {
            _aggregate = new TestAggregate(Guid.NewGuid());
            var testValue = "value D";

            _aggregate.ScheduleInFuture(DateTime.Now.AddSeconds(400), testValue);
            _aggregate.ScheduleInFuture(DateTime.Now.AddSeconds(400), "test value E");

            _futureEventA = _aggregate.GetEvents <FutureEventScheduledEvent>().First();
            _futureEvent_out_of_criteria = _aggregate.GetEvents <FutureEventScheduledEvent>().Skip(1).First();

            _aggregate.ClearEvents();
            _aggregate.CancelFutureEvents(testValue);
        }