Ejemplo n.º 1
0
        public void ReverseEnumerate()
        {
            AddValidBlocksWithFork();

            var revEnum = _chain.GetReverseEnumerator();
            var counter = 0;

            foreach (var _ in revEnum)
            {
                switch (counter)
                {
                case 0:
                    Assert.Equal(_4, _chain.RetrieveAlias(_hash3));
                    break;

                case 1:
                    Assert.Equal(_3, _chain.RetrieveAlias(_hash2));
                    break;

                case 2:
                    Assert.Equal(_2, _chain.RetrieveAlias(_hash1));
                    break;

                case 3:
                    Assert.Equal(_1, _chain.RetrieveAlias(BlockId.Genesis));
                    break;
                }

                counter++;
            }

            Assert.Equal(4, counter);
        }