コード例 #1
0
        public void Returns_Success_Message()
        {
            string message     = "Trading day has ended!";
            var    factory     = new Mock <IAssetFactory>();
            var    market      = new Mock <IMarket>();
            var    user        = new Mock <IUser>();
            var    userSession = new Mock <IUserSession>();

            market.Setup(x => x.UpdatePrices());

            var    broker = new BrokerMock(factory.Object, market.Object, userSession.Object);
            string result = broker.EndDayTraiding();

            Assert.AreEqual(message, result);
        }
コード例 #2
0
        public void Incoke_MarkedUpdatePrices()
        {
            var factory     = new Mock <IAssetFactory>();
            var market      = new Mock <IMarket>();
            var user        = new Mock <IUser>();
            var userSession = new Mock <IUserSession>();

            market.Setup(x => x.UpdatePrices());

            var broker = new BrokerMock(factory.Object, market.Object, userSession.Object);

            broker.EndDayTraiding();

            market.Verify(x => x.UpdatePrices(), Times.Once);
        }