示例#1
0
        public void Trade_BuySignalReceived_BuysStock()
        {
            // Arrange
            _trader.Balance = 100;
            _mockBroker.GetPrice(Arg.Is <string>(x => x == "AAPL"))
            .Returns(100);
            _mockSignal.Assess()
            .Returns(new Assessment {
                Recommendation = 1, Symbol = "AAPL"
            });

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

            // Assert
            _mockBroker.Received().Buy("AAPL", 1);
            _mockPortfolio.Received().Add("AAPL", 1);
        }
 public void PortfolioDisplay_CanAccessPortfolio()
 {
     _uut.PrintInformation(_portfolio);
     _portfolio.Received();
 }