예제 #1
0
 public void Approve_InvalidOrderId_DomainValidationExceptionThrown()
 {
     _orderService = OrderServiceTestHelper.CreateOrderService(
         OrderRepositoryTestHelper.GetOrderRepository_StubsGetById_ReturnsNull(_orderForApprovalId),
         MockRepository.GenerateStub <ISupplierRepository>(),
         MockRepository.GenerateStub <ICurrencyRepository>(),
         _userContext);
     Approve(_orderForApprovalId);
 }
예제 #2
0
        public void Approve_OrderWithNoItems_DomainValidationExceptionThrown()
        {
            var orderRepositoryStub = MockRepository.GenerateMock <IOrderRepository>();

            orderRepositoryStub.Stub(x => x.GetById(_orderForApprovalId)).Return(OrderRepositoryTestHelper.GetOrder(_orderForApprovalId));
            _orderService = OrderServiceTestHelper.CreateOrderService(
                orderRepositoryStub,
                MockRepository.GenerateStub <ISupplierRepository>(),
                MockRepository.GenerateStub <ICurrencyRepository>(),
                _userContext);
            Approve(_orderForApprovalId);
            Assert.IsTrue(_domainValidationException.ResultContainsMessage(Messages.ApprovalWithZeroItems));
        }