コード例 #1
0
        public async void GetAllOrdersHandlerFailure()
        {
            var mockOrder = new MockOrderData();

            mockOrder.CreateOrder();
            mockOrder.CreateOrder();
            GetAllOrderQuery   getAllOrderQuery   = new GetAllOrderQuery();
            GetAllOrderHandler getAllOrderHandler = new GetAllOrderHandler();
            var actual = await getAllOrderHandler.Handle(getAllOrderQuery, new CancellationToken());

            Assert.NotEqual(1, actual.Count());
        }
コード例 #2
0
        public async void GetAllOrdersHandlerSuccess()
        {
            var mockOrder = new MockOrderData();

            mockOrder.CreateOrder();
            mockOrder.CreateOrder();
            GetAllOrderQuery   getAllOrderQuery   = new GetAllOrderQuery();
            GetAllOrderHandler getAllOrderHandler = new GetAllOrderHandler();
            var actualHandle = await getAllOrderHandler.Handle(getAllOrderQuery, new CancellationToken());

            var actual    = actualHandle.Select(x => x.OrderId).Count();
            var orderList = OrdersInMemory.GetInstance();
            var expected  = orderList.OrderList.Count();

            Assert.Equal(expected, actual);
        }