public void Reorder() { var price1 = new Price("test2"); var price2 = new Price("test3"); var order = new Order(price, address); order.TryOrder(offer, 10); var orders = new[] { new Order(price1, address), new Order(price2, address) }; var offer1 = new Offer(price1, 100) { ProductId = 1 }; orders[0].TryOrder(offer1, 10); var offer2 = new Offer(price2, 150) { ProductId = 1 }; orders[1].TryOrder(offer2, 1); var log = new StringBuilder(); ReorderCommand <Order> .Reorder(order, orders, new[] { offer1, offer2 }, log); Assert.That(order.Lines.Count, Is.EqualTo(0)); Assert.That(orders[0].Lines.Count, Is.EqualTo(1)); Assert.That(orders[0].Lines[0].Count, Is.EqualTo(20)); }
public override void MoveRow(UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath) { var deleteAt = sourceIndexPath.Row; var insertAt = destinationIndexPath.Row; if (destinationIndexPath.Row < sourceIndexPath.Row) { deleteAt += 1; } else { insertAt += 1; } ReorderCommand.Execute(new Tuple <int, int>(deleteAt, insertAt)); }
public virtual void ExecuteReorder(ReorderCommand command) { command.Sender = Player; Player.Reorder.OnNext(command); }
public virtual void ReorderHandler(ReorderCommand command) { this.Reorder(command.Sender as PlayerViewModel); }