public async Task GivenAnInstanceThenAllPropertiesAreSerializedAsync()
        {
            var eventStore = new Mock <IEventStore <SequencedEvents, ulong> >();
            var reconciler = new Mock <IAggregateReconciler>();
            var instance   = new DefaultEventReconciler <SequencedEvents>(eventStore.Object, reconciler.Object);
            EventSequenceAdvancedAsyncEventArgs?original = default;

            _ = eventStore
                .Setup(store => store.ReadAsync(
                           It.Is <ulong>(value => value == ulong.MinValue),
                           It.IsAny <CancellationToken?>(),
                           It.IsAny <ushort>()))
                .ReturnsAsync(new[]
            {
                new SequencedEvents(1, CreateEvents()),
            });

            _ = eventStore
                .Setup(store => store.ReadAsync(
                           It.Is <ulong>(value => value > ulong.MinValue),
                           It.IsAny <CancellationToken?>(),
                           It.IsAny <ushort>()))
                .ReturnsAsync(Enumerable.Empty <SequencedEvents>());

            instance.EventSequenceAdvanced += (sender, e) => Task.FromResult(original = e);

            ulong?current = await instance.ReconcileAsync();

            EventSequenceAdvancedAsyncEventArgs deserialized = original !.Clone();

            Assert.NotSame(original, deserialized);
            Assert.Equal(original !.Sequence, deserialized.Sequence);
        }
        public async Task GivenNoSequenceThenAZeroSequenceIsRequestedAsync()
        {
            _ = EventStore
                .Setup(store => store.ReadAsync(
                           It.IsAny <ulong>(),
                           It.IsAny <CancellationToken?>(),
                           It.IsAny <ushort>()))
                .ReturnsAsync(Enumerable.Empty <SequencedEvents>());

            _ = await instance.ReconcileAsync();

            EventStore.Verify(
                store => store.ReadAsync(
                    It.IsAny <ulong>(),
                    It.IsAny <CancellationToken?>(),
                    It.IsAny <ushort>()),
                times: Times.Once);

            EventStore.Verify(
                store => store.ReadAsync(
                    It.Is <ulong>(value => value == default),
                    It.IsAny <CancellationToken?>(),
                    It.IsAny <ushort>()),
                times: Times.Once);
        }