public void RewindDataIndex_Flush()
        {
            Mock <IDateTimeProvider> dateTimeProviderMock = new Mock <IDateTimeProvider>();
            Mock <ICoinView>         coinViewMock         = new Mock <ICoinView>();

            this.SetupMockCoinView(coinViewMock);

            Mock <IFinalizedBlockInfoRepository> finalizedBlockInfoRepositoryMock = new Mock <IFinalizedBlockInfoRepository>();

            finalizedBlockInfoRepositoryMock.Setup(s => s.GetFinalizedBlockInfo()).Returns(new HashHeightPair());

            RewindDataIndexCache rewindDataIndexCache = new RewindDataIndexCache(dateTimeProviderMock.Object, this.Network, finalizedBlockInfoRepositoryMock.Object, new Checkpoints());

            rewindDataIndexCache.Initialize(20, coinViewMock.Object);

            rewindDataIndexCache.SaveAndEvict(15, null);
            var items = rewindDataIndexCache.GetMemberValue("items") as ConcurrentDictionary <OutPoint, int>;

            items.Should().HaveCount(12);
            this.CheckCache(items, 15, 9);
        }
        public void RewindDataIndex_Save()
        {
            var dateTimeProviderMock = new Mock <IDateTimeProvider>();
            var coinViewMock         = new Mock <ICoinView>();

            this.SetupMockCoinView(coinViewMock);

            var finalizedBlockInfoRepositoryMock = new Mock <IFinalizedBlockInfoRepository>();

            finalizedBlockInfoRepositoryMock.Setup(s => s.GetFinalizedBlockInfo()).Returns(new HashHeightPair());

            var rewindDataIndexCache = new RewindDataIndexCache(dateTimeProviderMock.Object, this.Network, finalizedBlockInfoRepositoryMock.Object, new Checkpoints());

            rewindDataIndexCache.Initialize(20, coinViewMock.Object);

            rewindDataIndexCache.SaveAndEvict(21, new Dictionary <OutPoint, int>()
            {
                { new OutPoint(new uint256(21), 0), 21 }
            });
            var items = rewindDataIndexCache.GetMemberValue("items") as ConcurrentDictionary <OutPoint, int>;

            items.Should().HaveCount(21);
            this.CheckCache(items, 21, 1);
        }