Esempio n. 1
0
        public void TestTraderGainsGoldOnSell(int itemCost, int expectedShopGold)
        {
            Item item = new MiscItem("testItem", itemCost);

            shop.Inventory.Add(item);
            shop.Inventory.SelectItem(item);
            shop.Sell(shopper);

            Assert.AreEqual(shop.Gold, expectedShopGold);
        }
Esempio n. 2
0
        public async void Sell(Candle candle)
        {
            try
            {
                var orderResult = await _trader.Sell(_inMemoryBot, candle.ClosePrice);

                if (orderResult == null)
                {
                    return;
                }
                await ProcessOrderResult(orderResult, candle);

                Log($"SELL order placed for {orderResult.AveragePrice}");
            }
            catch (Exception e)
            {
                _logger.Error(e);
            }
        }
 public void Sell()
 {
     trader.Sell(otherTrader);
 }