public void ConsensusAlgorithmForSameChainsTest()
        {
            Lib.Blockchain blockchain1 = new Lib.Blockchain();
            Lib.Blockchain blockchain2 = new Lib.Blockchain();
            Lib.Blockchain blockchain3 = new Lib.Blockchain();

            List <List <Block> > neighbourChains = new List <List <Block> >();

            neighbourChains.Add(blockchain3.Chain);
            neighbourChains.Add(blockchain2.Chain);

            Assert.IsFalse(blockchain1.ResolveConflict(neighbourChains));
        }
        public void ConsensusAlgorithmForDifferentChainsTest()
        {
            string hashToCompare = "0";//determines the difficulty of mining

            Lib.Blockchain blockchain1 = new Lib.Blockchain(hashToCompare);
            Lib.Blockchain blockchain2 = new Lib.Blockchain(hashToCompare);
            Lib.Blockchain blockchain3 = new Lib.Blockchain(hashToCompare);

            blockchain2.MineNewBlock();

            List <List <Block> > neighbourChains = new List <List <Block> >();

            neighbourChains.Add(blockchain3.Chain);
            neighbourChains.Add(blockchain2.Chain);

            Assert.IsTrue(blockchain1.ResolveConflict(neighbourChains));
            Assert.IsTrue(blockchain1.Chain.Count == 2);
        }