Esempio n. 1
0
        public void CompleteOrderTest()
        {
            NMock.Actions.InvokeAction saveOrder = new NMock.Actions.InvokeAction(
                new Action(() => getOrder = order));

            orderManagementDaoMock.Expects.Any.MethodWith(x => x.SaveOrUpdate(order)).Will(saveOrder);
            orderInformationDaoMock.Expects.Any.MethodWith(x => x.GetOrderById(order.Id)).WillReturn(getOrder);
            orderInformationDaoMock.Expects.Any.MethodWith(x => x.GetOrderById(order.Id)).WillReturn(getOrder);

            oms.CreateNewOrder(order);
            oms.CompleteOrder(order.Id);
            orderManagementDaoMock.Expects.One.MethodWith(x => x.SaveOrUpdate(order)).Will(saveOrder);

            getOrder = ois.GetOrderById(order.Id);
            Assert.IsTrue(getOrder.Status.Equals(Order.OrderState.DELIVERED));
        }
Esempio n. 2
0
 public void CompleteOrder(long orderId)
 {
     OrderManagementService.CompleteOrder(orderId);
 }