public async Task Should_Command_Asynchronously() { var handler = new OrderHandler(); var fulfill = new FulfillOrder { OrderId = 1 }; await handler.CommandAsync(fulfill); Assert.AreEqual(1, fulfill.OrderId); }
public void Should_Command_All() { var handler = new OrderHandler(); var fulfill = new FulfillOrder { OrderId = 1 }; var results = handler.CommandAll <bool>(fulfill); var responses = results.ToArray(); Assert.AreEqual(2, responses.Length); Assert.IsTrue(responses.All(b => b)); }
public async Task Should_Command_All_Asycnhronously() { var handler = new OrderHandler(); var fulfill = new FulfillOrder { OrderId = 1 }; var results = await handler.CommandAllAsync <bool>(fulfill); var responses = results.ToArray(); Assert.AreEqual(2, responses.Length); Assert.IsTrue(responses.All(b => b)); }
public Promise Fulfill(FulfillOrder fulfill) { return(new Promise <bool>((resolve, reject) => resolve(true, true))); }