Ejemplo n.º 1
0
        public void RequestExchangeCoins()
        {
            var initialCoins    = _testModel.Coins;
            var initialCrystals = _testModel.Crystals;

            var promise = _testModel.ExchangeCoinsToCrystals(10);

            Assert.IsTrue(!promise.IsCompleted);

            _timeModel.RealTimeSinceStartup.ReturnsForAnyArgs(4);
            _testModel.Update();

            Assert.IsTrue(promise.IsCompleted);
            Assert.IsTrue(!promise.IsFaulted);
            Assert.IsTrue(_testModel.Coins == initialCoins - 10);
            Assert.IsTrue(_testModel.Crystals == initialCrystals + 10);
        }