Пример #1
0
        public void ShouldReturnNotEnoughPointsErrorMessageForIncrementingPriceItem(Int32 quantity, Int32 initialPoints, Int32 expectedPointsNeeded)
        {
            var item = new IncrementingPriceItem();

            var player = new Player()
            {
                Points = initialPoints
            };

            Either <BuyResult, String> result = item.TryBuy(quantity, player);

            Assert.True(result.IsRight());
            Assert.Equal(String.Format(Item.NotEnoughPointsErrorMessage, expectedPointsNeeded, item.GetSpecificNameForNotEnoughToBuy(player)), result.Right());
        }
Пример #2
0
        public void ShouldReturnIncrementingPrice(Int32 quantity, Int32 points, Int32 expectedQuantity, Int32 expectedPointsSpent)
        {
            var item = new IncrementingPriceItem();

            var player = new Player()
            {
                Points = points
            };

            Either <BuyResult, String> result = item.TryBuy(quantity, player);

            Assert.True(result.IsLeft());
            Assert.Equal(expectedQuantity, result.Left().QuantityPurchased);
            Assert.Equal(expectedPointsSpent, result.Left().PointsSpent);
        }