public void NormalTest() { var blockSet = new BlockSet(); var blocks = MockSeveralBlocks(5); foreach (var block in blocks) { blockSet.AddBlock(block); } Assert.True(blockSet.InvalidBlockCount == 5); blockSet.RemoveExecutedBlock(blocks[0].BlockHashToHex); Assert.True(blockSet.ExecutedBlockCount == 1); Assert.True(blockSet.InvalidBlockCount == 4); blockSet.RemoveExecutedBlock(blocks[0].BlockHashToHex); Assert.True(blockSet.ExecutedBlockCount == 1); Assert.True(blockSet.InvalidBlockCount == 4); blockSet.RemoveExecutedBlock(blocks[1].BlockHashToHex); Assert.True(blockSet.ExecutedBlockCount == 2); Assert.True(blockSet.InvalidBlockCount == 3); Assert.True(blockSet.IsBlockReceived(Hash.LoadHex(blocks[2].BlockHashToHex), blocks[2].Index)); Assert.False(blockSet.IsBlockReceived(Hash.Generate(), blocks[2].Index)); }