Ejemplo n.º 1
0
 private void btnSell_Click(object sender, System.EventArgs e)
 {
     if (lboxOwned.SelectedIndex == -1)
         return;
     var order = _account.CreateSellOrder(((Security)lboxOwned.Items[lboxOwned.SelectedIndex]).Name, ulong.Parse(txtQuantity.Text), ulong.Parse(txtPrice.Text));
     _marketplace.Sell(order);
 }
Ejemplo n.º 2
0
        public void MarketplaceTest_Sell()
        {
            var target = new Marketplace("Iron Market");
            var order  = new SellOrder(new Security("Iron Ore", 1ul), 1ul);

            target.Sell(order);
            Assert.AreEqual(1, target.SellOrders.Count);
        }
Ejemplo n.º 3
0
        public async Task SellItems(string item = "items", string amount = null)
        {
            EmbedBuilder builder = new EmbedBuilder
            {
                Color = Color.Green
            };

            await ReplyAsync("", false, Marketplace.Sell(builder, Context.User.Id.ToString().ToLower(), item, amount, Program.mineprices, Program.pickprices, Program.craftprice));
        }
Ejemplo n.º 4
0
        public void MarketplaceTest_Update_MatchExact_InvertedOrder()
        {
            var target = new Marketplace("Iron Market");

            target.Sell(new SellOrder(new Security("Iron Ore", 100ul), 1ul));
            target.Buy(new BuyOrder("Iron Ore", 1ul, 100ul, new Account(100ul)));
            target.Update();
            Assert.AreEqual(0, target.BuyOrders.Count);
            Assert.AreEqual(0, target.SellOrders.Count);
        }