public void TrackToPersistentStore_CalledAfterDisposeWithAggregateRootPreviouslyBeingTracked_ExpectNewlySourcedDomainEventsAreTrackedToPersistentObserver()
        {
            using (var tracker = new LambdaPostPersistenceDomainEventTracker<AggregateRootWithTwoDomainEvents>())
            {
                var persistentObserver = Substitute.For<Source.Of<object>>();
                var tracked = CreateAggregateRootTrackedBy(tracker, persistentObserver);
                tracker.Dispose();
                tracker.TrackToPersistentStore(tracked, persistentObserver);

                var domainEvent = new object();
                tracked.SourceFirstDomainEvent(domainEvent);
                persistentObserver.Received(1)(tracked, domainEvent);
            }
        }
        public void Dispose_Called_ExpectPreviouslyTrackedAggregateRootsAreNotBeingSilentlyTrackedToPersistentStore()
        {
            using (var tracker = new LambdaPostPersistenceDomainEventTracker<AggregateRootWithTwoDomainEvents>())
            {
                var persistentObserver = Substitute.For<Source.Of<object>>();
                var aggregateRoots = new[]
                    {
                        CreateAggregateRootTrackedBy(tracker, persistentObserver),
                        CreateAggregateRootTrackedBy(tracker, persistentObserver)
                    };

                tracker.Dispose();
                aggregateRoots.ForEach(aggregateRoot => aggregateRoot.SourceFirstDomainEvent(new object()));
                persistentObserver.DidNotReceive()(Arg.Any<object>(), Arg.Any<object>());
            }
        }