Ejemplo n.º 1
0
        public void IncreaseBuyerStockQty_DecreaseBuyerBalance()
        {
            var tradableType = new TradableType {
                Price = 1000, Type = "TestType1"
            };
            var buyerStock = new Stock {
                Quantity = 100, TradableType = tradableType
            };
            var stockForBuy = new Stock {
                Quantity = 10, TradableType = tradableType
            };

            var trader = new Trader
            {
                Balance = 100000,
                Assets  = new List <Stock>
                {
                    new Stock(),
                    buyerStock
                }
            };

            BusinessService.Acquire(trader, stockForBuy);
            Assert.AreEqual(buyerStock.Quantity, 110);
            Assert.AreEqual(trader.Balance, 90000);
        }