public AzureBusService(IOptions <Infrastructure.ServiceBus.AzureServiceBusSettings> options, ILogger <AzureBusService> logger,
                               Func <Infrastructure.ServiceBus.AzureServiceBusSettings, IQueueClient> createQueueClient, IServiceProvider serviceProvider)
        {
            _settings = options.Value;

            if (_settings == null)
            {
                throw new NullReferenceException("options cannot be null");
            }

            _serviceProvider = serviceProvider;

            _logger            = logger;
            _createQueueClient = createQueueClient;
        }
        private static IQueueClient CreateQueueClient(Infrastructure.ServiceBus.AzureServiceBusSettings options)
        {
            ServiceBusConnectionStringBuilder connectionStringBuilder = new ServiceBusConnectionStringBuilder
            {
                Endpoint      = options.QueueEndpoint,
                EntityPath    = options.QueueName,
                SasKeyName    = options.QueueAccessPolicyName,
                SasKey        = options.QueueAccessPolicyKey,
                TransportType = TransportType.Amqp
            };

            return(new QueueClient(connectionStringBuilder)
            {
                PrefetchCount = options.PrefetchCount
            });
        }