private static VecteurController SetupVecteurController(IVecteurActions actionClientMock, IPublicOrder orderManagerMock,
                                                                IDigitizationHelper digitizationHelperMock, IMessageBusCallHelper busHelper, IMailHelper mailHelperMock)
        {
            var bus             = Mock.Of <IBus>();
            var parameterHelper = Mock.Of <IParameterHelper>();
            var user            = new User();
            var dataBuilder     = Mock.Of <IDataBuilder>(x => x.AddAuftraege(It.IsAny <IEnumerable <int> >()) == x &&
                                                         x.AddValue(It.IsAny <string>(), It.IsAny <object>()) == x &&
                                                         x.GetAuftraege(It.IsAny <IEnumerable <int> >()) == new List <Auftrag>
            {
                new Auftrag(new OrderItem(),
                            new Ordering(), new BestellformularVe(new OrderItem()),
                            new BestellformularVe(new OrderItem()), Person.FromUser(user))
            });

            var controller = new VecteurController(actionClientMock, orderManagerMock, digitizationHelperMock, busHelper, mailHelperMock, bus,
                                                   parameterHelper, dataBuilder);
            var controllerContext = new HttpControllerContext();
            var request           = new HttpRequestMessage();

            request.Headers.Add("X-ApiKey", "myKey");
            ApiKeyChecker.Key = "myKey";

            // Don't forget these lines, if you do then the request will be null.
            controllerContext.Request    = request;
            controller.ControllerContext = controllerContext;

            return(controller);
        }
 public VecteurController(IVecteurActions vecteurActionsClient,
                          IPublicOrder orderManagerClient,
                          IDigitizationHelper digitizationHelper,
                          IMessageBusCallHelper messageBusCallHelper,
                          IMailHelper mailHelper,
                          IBus bus,
                          IParameterHelper parameterHelper,
                          IDataBuilder dataBuilder)
 {
     this.vecteurActionsClient = vecteurActionsClient ?? throw new ArgumentNullException(nameof(vecteurActionsClient));
     this.orderManagerClient   = orderManagerClient ?? throw new ArgumentNullException(nameof(orderManagerClient));
     this.digitizationHelper   = digitizationHelper ?? throw new ArgumentNullException(nameof(digitizationHelper));
     this.messageBusCallHelper = messageBusCallHelper ?? throw new ArgumentNullException(nameof(messageBusCallHelper));
     this.mailHelper           = mailHelper ?? throw new ArgumentNullException(nameof(mailHelper));
     this.bus             = bus ?? throw new ArgumentNullException(nameof(bus));
     this.parameterHelper = parameterHelper ?? throw new ArgumentNullException(nameof(parameterHelper));
     this.dataBuilder     = dataBuilder ?? throw new ArgumentNullException(nameof(dataBuilder));
 }