public void DeleteQueue()
        {
            WebRequestFactory requestFactory = ServiceBusHelper.GetWebRequestFactory();
            HttpWebRequest request = requestFactory.CreateWebRequest("DELETE", _queueUri);

            var webClient = new WebClientWrapper { ThrowOnHttpError = true };
            HttpWebResponse repsonse = webClient.SendRequest(request);
        }
        public void CreateSubscriptionAndSendOneMessage()
        {
            WebRequestFactory requestFactory = ServiceBusHelper.GetWebRequestFactory();
            var webClient = new WebClientWrapper { ThrowOnHttpError = true };

            XElement subscriptionDescription = ObjectDescriptionBuilder.CreateSubscriptionDescription(null);
            HttpWebRequest subscriptionRequest = requestFactory.CreateWebRequestWithData("PUT", _subscriptionUri, subscriptionDescription.ToString());
            HttpWebResponse subscriptionRepsonse = webClient.SendRequest(subscriptionRequest);
        }
        public void CreateQueue()
        {
            var rule1 = new AccessRule { UserName = TestUsers.User1.UserName, ServiceBusNamespace = _serviceBusNamespace };
            rule1.Permissions.Add(AccessRight.Listen);
            rule1.Permissions.Add(AccessRight.Send);

            var rule2 = new AccessRule { UserName = TestUsers.User2.UserName, ServiceBusNamespace = _serviceBusNamespace };
            rule2.Permissions.Add(AccessRight.Listen);

            var rule3 = new AccessRule { UserName = TestUsers.User3.UserName, ServiceBusNamespace = _serviceBusNamespace };
            rule3.Permissions.Add(AccessRight.Send);

            var rules = new List<AccessRule> { rule1, rule2, rule3 };

            XElement queueDescription = ObjectDescriptionBuilder.CreateQueueDescription(rules);

            WebRequestFactory requestFactory = ServiceBusHelper.GetWebRequestFactory();
            HttpWebRequest request = requestFactory.CreateWebRequestWithData("PUT", _queueUri, queueDescription.ToString());

            var webClient = new WebClientWrapper { ThrowOnHttpError = true };
            HttpWebResponse repsonse = webClient.SendRequest(request);
        }
        public void DeleteSubscription()
        {
            WebRequestFactory requestFactory = ServiceBusHelper.GetWebRequestFactory();
            var webClient = new WebClientWrapper { ThrowOnHttpError = true };

            HttpWebRequest subscriptionRequest = requestFactory.CreateWebRequest("DELETE", _subscriptionUri);
            HttpWebResponse subscriptionRepsonse = webClient.SendRequest(subscriptionRequest);
        }