public CheckScannerController(IConfigurationWrapper configuration, ICheckScannerService checkScannerService, IAuthenticationService authenticationService, ICommunicationService communicationService, ICryptoProvider cryptoProvider, IMessageQueueFactory messageQueueFactory = null, IMessageFactory messageFactory = null) { _checkScannerService = checkScannerService; _authenticationService = authenticationService; _communicationService = communicationService; _cryptoProvider = cryptoProvider; var b = configuration.GetConfigValue("CheckScannerDonationsAsynchronousProcessingMode"); _asynchronous = b != null && bool.Parse(b); if (_asynchronous) { var donationsQueueName = configuration.GetConfigValue("CheckScannerDonationsQueueName"); // ReSharper disable once PossibleNullReferenceException _donationsQueue = messageQueueFactory.CreateQueue(donationsQueueName, QueueAccessMode.Send); _messageFactory = messageFactory; } }