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); }
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); }
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)); }
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); }