public void Order() { Profile account = users[0]; //ERC223 items[0].Metadata.Set <BigInteger>("Balance", 20); var success = BCExchangeService.Order(account, items[0], items[1], 0xFFFFFFF).Result; Assert.True(success); Thread.Sleep(3000); var orders = ListOrders(items[0], items[1], users[0]); Assert.NotEmpty(orders); //ERC721 items[0].Metadata.Set <BigInteger>("Balance", 20); success = BCExchangeService.Order(account, items[0], items[2], 0xFFFFFFF).Result; Assert.True(success); Thread.Sleep(3000); orders = ListOrders(items[0], items[2], users[0]); Assert.NotEmpty(orders); }
public void CancelOrder() { Profile account = users[1]; //ERC223 items[0].Metadata.Set <BigInteger>("Balance", 20); var success = BCExchangeService.Order(account, items[0], items[1], 0xFFFFFFF).Result; Assert.True(success); //ERC721 items[0].Metadata.Set <BigInteger>("Balance", 20); success = BCExchangeService.Order(account, items[0], items[2], 0xFFFFFFF).Result; Assert.True(success); Thread.Sleep(3000); var orders = ListOrders(items[0], items[1], users[1]); Assert.True(orders.Length == 2); success = BCExchangeService.CancelOrder(account, orders[0]).Result; Assert.True(success); Thread.Sleep(3000); //FIXME is it correct? //cancel non-existing order success = BCExchangeService.CancelOrder(account, orders[0]).Result; Assert.True(success); Thread.Sleep(3000); orders = ListOrders(items[0], items[1], users[1]); Assert.True(orders.Length == 1); orders = ListOrders(items[0], items[2], users[1]); Assert.True(orders.Length == 1); success = BCExchangeService.CancelOrder(account, orders[0]).Result; Assert.True(success); Thread.Sleep(3000); orders = ListOrders(items[0], items[2], users[1]); Assert.True(orders.Length == 0); }