Пример #1
0
        public void Trade_NoMoney_CannotBuyGoodStock()
        {
            // Arrange
            _trader.Balance = 0;
            _mockBroker.GetPrice("AAPL")
            .Returns(100);
            _mockSignal.Assess()
            .Returns(new Assessment {
                Recommendation = 1, Symbol = "AAPL"
            });

            // Act
            _trader.Register(_mockSignal);
            _trader.Trade();

            // Assert
            _mockBroker.DidNotReceive().Buy(Arg.Any <string>(), Arg.Any <int>());
            _mockPortfolio.DidNotReceive().Add(Arg.Any <string>(), Arg.Any <int>());
        }