public async Task CanStoreAndRetrieveAggregate()
        {
            // Arrange
            var aggregate = new TestAggregate();
            var @event    = CreateEvent();

            aggregate.InvokeRaiseEvent(@event);
            var subject = CreateSubject();

            // Act
            await subject.Save(aggregate);

            var result = await subject.Get(aggregate.Id);

            // Assert
            var restoredEvent = result.AppliedEvents.Single() as TestEvent;

            Assert.That(restoredEvent.Property, Is.EqualTo(@event.Property));
        }
        public async Task CanStoreAndRetrieveAggregateWithNumberOfEventsGreaterThanSliceSize()
        {
            // Arrange
            var aggregate   = new TestAggregate();
            var eventsCount = Math.Ceiling(AggregateRepository <TestAggregate> .EventsSliceSize * 1.5);

            for (var i = 0; i < eventsCount; i++)
            {
                aggregate.InvokeRaiseEvent(CreateEvent());
            }

            var subject = CreateSubject();

            // Act
            await subject.Save(aggregate);

            var result = await subject.Get(aggregate.Id);

            // Assert
            Assert.That(aggregate.AppliedEvents.Count(), Is.EqualTo(eventsCount));
        }