Beispiel #1
0
        public void ItemsAndSyncTest()
        {
            var ledger = new Ledger();

            ledger.Initialize();

            Assert.AreNotEqual(ledger, null);
            Assert.IsTrue(ledger.EnumerateChain().Any());
            Assert.IsTrue(ledger.EnumerateChain().Count() == 1);

            ledger.AddBlockByData("This is some test data for block1!");
            ledger.AddBlockByData("This is some test data for block2!");
            ledger.AddBlockByData("This is some test data for block3!");

            Assert.IsTrue(ledger.EnumerateChain().Any());
            Assert.IsTrue(ledger.EnumerateChain().Count() == 4);

            ledger = new Ledger();
            ledger.Initialize();

            Assert.IsTrue(ledger.EnumerateChain().Any());
            Assert.IsTrue(ledger.EnumerateChain().Count() == 4);

            RemoveDataFile();
        }
Beispiel #2
0
        private static void TestLedger()
        {
            var ledger = new Ledger();

            ledger.Initialize();

            foreach (var blockHeader in ledger.EnumerateChain())
            {
            }

            ledger.AddBlockByData("TestData 1");
            ledger.AddBlockByData("TestData 2");
            ledger.AddBlockByData("TestData 3");

            foreach (var blockHeader in ledger.EnumerateChain())
            {
            }
        }