コード例 #1
0
        public void DebtRatio_Positive()
        {
            var ledger = new BitswapLedger {
                DataSent = 1024 * 1024
            };

            Assert.IsTrue(ledger.DebtRatio >= 1);
            Assert.IsFalse(ledger.IsInDebt);
        }
コード例 #2
0
        public void DebtRatio_Negative()
        {
            var ledger = new BitswapLedger {
                DataReceived = 1024 * 1024
            };

            Assert.IsTrue(ledger.DebtRatio < 1);
            Assert.IsTrue(ledger.IsInDebt);
        }
コード例 #3
0
        public void Defaults()
        {
            var ledger = new BitswapLedger();

            Assert.IsNull(ledger.Peer);
            Assert.AreEqual(0ul, ledger.BlocksExchanged);
            Assert.AreEqual(0ul, ledger.DataReceived);
            Assert.AreEqual(0ul, ledger.DataSent);
            Assert.AreEqual(0f, ledger.DebtRatio);
            Assert.IsTrue(ledger.IsInDebt);
        }