예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
 public Promise Fulfill(FulfillOrder fulfill)
 {
     return(new Promise <bool>((resolve, reject) => resolve(true, true)));
 }