Пример #1
0
        public void WhenMarketValueBelowZeroAndTransactionCostAboveTolerance_ThenBondHasWarning()
        {
            var bond = new BondStock
            {
                Price    = -300000m,
                Quantity = 200m
            };

            Assert.IsTrue(bond.HasWarning);
        }
Пример #2
0
        public void WhenMarketValueAboveZeroAndTransactionCostBelowTolerance_ThenBondHasNoWarning()
        {
            var bond = new BondStock
            {
                Price    = 10m,
                Quantity = 20m
            };

            Assert.IsFalse(bond.HasWarning);
        }
Пример #3
0
        public void WhenTransactionCostCalled_ThenMarketValueMultipliedByFeeFactor()
        {
            var bond = new BondStock
            {
                Price    = 10m,
                Quantity = 20m
            };

            Assert.AreEqual(4m, bond.TransactionCost);
        }
Пример #4
0
        public void WhenMarketPriceCalled_ThenPriceMultipliedByQuantity()
        {
            var bond = new BondStock
            {
                Price    = 10m,
                Quantity = 20m
            };

            Assert.AreEqual(200m, bond.MarketValue);
        }
Пример #5
0
        public void WhenTypeCalled_ThenBondReturned()
        {
            var bond = new BondStock
            {
                Price    = 10m,
                Quantity = 20m
            };

            Assert.AreEqual(StockType.Bond, bond.Type);
        }
Пример #6
0
        public void WhenToleranceCalled_Then_100000_Returned()
        {
            var bond = new BondStock();

            Assert.AreEqual(100000m, bond.Tolerance);
        }