public void should_clone_peer()
        {
            var peer1  = new StampPeer(Guid.NewGuid());
            var block1 = peer1.GenerateBlock("001", DateTime.Now);

            peer1.AddBlock(block1);
            var peer2  = peer1.Clone();
            var block2 = peer1.GenerateBlock("002", DateTime.Now);

            peer1.AddBlock(block2);
            peer2.AddBlock(block2);
        }
        public void should_calculate_peer_hash()
        {
            var peer1  = new StampPeer(Guid.NewGuid());
            var block1 = peer1.GenerateBlock("001", DateTime.Now);

            peer1.AddBlock(block1);
            var peer2  = peer1.Clone();
            var block2 = peer1.GenerateBlock("002", DateTime.Now);

            peer1.AddBlock(block2);
            peer2.AddBlock(block2);

            Assert.AreEqual(peer1.PeerHash, peer2.PeerHash);
        }
        public void should_throw_exception_of_duplicate_block_in_chain()
        {
            var peer  = new StampPeer(Guid.NewGuid());
            var stamp = DateTime.Now;
            var block = peer.GenerateBlock("001", stamp);

            peer.AddBlock(block);
            try
            {
                peer.AddBlock(block);
            }
            catch (Exception e)
            {
                Assert.AreEqual("Invalid previous block hash", e.Message);
            }
        }