Exemplo n.º 1
0
        public void SellItemWithoutPriceTest()
        {
            var itemWithoutBuyPrice = new CollectionItemInstance(Guid.NewGuid(), new ItemDefinition(Guid.NewGuid())
            {
                maxStackSize = 5, buyPrice = new [] { new CurrencyDecorator(_gold, 10f) }
            });

            _vendorCollection.Add(ToProduct(itemWithoutBuyPrice), 3);

            var canBuy = _vendor.CanSellToVendor(_customer, new VendorProduct <IItemInstance>(itemWithoutBuyPrice, itemWithoutBuyPrice.itemDefinition.buyPrice, itemWithoutBuyPrice.itemDefinition.sellPrice), 1);

            Assert.AreEqual(Errors.VendorProductHasNoPrice, canBuy.error);
            Assert.IsFalse(canBuy.result);
        }