public Task SendAsync(IList <Message> messages)
        {
            if (string.IsNullOrEmpty(ConnectionString))
            {
                throw new InvalidOperationException("EventHubService not connected");
            }

            return(Task.Delay(10).ContinueWith(t =>
            {
                lock (MessageDataSent)
                    MessageDataSent.Add(messages);
            }));
        }
        public Task SendAsync(IEnumerable <ServiceBusMessage> messages, System.Threading.CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(ConnectionString))
            {
                throw new InvalidOperationException("ServiceBusService not connected");
            }

            return(Task.Delay(10, cancellationToken).ContinueWith(t =>
            {
                lock (MessageDataSent)
                    MessageDataSent.Add(new List <ServiceBusMessage>(messages));
            }, cancellationToken));
        }