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);
        }
        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");
        }
Ejemplo n.º 3
0
        public void When_raising_future_event()
        {
            _testCommand = new ScheduleEventInFutureCommand(DateTime.Now, Guid.NewGuid(), "test value");

            _aggregate = new TestAggregate(_testCommand.AggregateId);
            _aggregate.ScheduleInFuture(_testCommand.RaiseTime, _testCommand.Value);

            _futureEventEnvelop = _aggregate.GetEvent <FutureEventScheduledEvent>();
            _aggregate.RaiseScheduledEvent(_futureEventEnvelop.Id);
            _producedEvent           = _aggregate.GetEvent <TestDomainEvent>();
            _futureEventOccuredEvent = _aggregate.GetEvent <FutureEventOccuredEvent>();
        }
 public void When_scheduling_future_event()
 {
     _aggregate = new TestAggregate(Guid.NewGuid());
     _aggregate.ScheduleInFuture(DateTime.Now.AddSeconds(400), "value D");
     ((IAggregate)_aggregate).ClearUncommittedEvents();
 }