public void Approve_InvalidOrderId_DomainValidationExceptionThrown() { _orderService = OrderServiceTestHelper.CreateOrderService( OrderRepositoryTestHelper.GetOrderRepository_StubsGetById_ReturnsNull(_orderForApprovalId), MockRepository.GenerateStub <ISupplierRepository>(), MockRepository.GenerateStub <ICurrencyRepository>(), _userContext); Approve(_orderForApprovalId); }
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)); }