public async Task DeleteRule()
        {
            var random    = new Random();
            var topicName = string.Format("a{0}b", random.Next());
            var subName   = "sub";
            var ruleName  = "rule";

            var filter = new SqlFilter("0=0");

            var client = new BusManagementClient(connection);
            await client.TopicCreate(topicName);

            await client.SubscriptionCreate(topicName, subName);

            await client.RuleCreate(topicName, subName, ruleName, filter);

            await client.RuleDelete(topicName, subName, ruleName);

            try
            {
                await client.RuleGet(topicName, subName, ruleName);

                Assert.Fail();
            }
            catch
            {
            }

            //cleanup
            await client.TopicDelete(topicName);
        }
        public async Task TopicDoesntExist()
        {
            var random = new Random();
            var name   = string.Format("a{0}b", random.Next());
            var client = new BusManagementClient(connection);

            var exists = await client.TopicExists(name);

            Assert.IsFalse(exists);
        }
示例#3
0
        public void TearDown()
        {
            var client = new BusManagementClient(connection).Client;

            Task.WaitAll(
                new Task[] {
                client.DeleteTopicAsync(recieveName)
            }
                );
        }
        public async Task SubscriptionDoesntExist()
        {
            var random    = new Random();
            var topicName = string.Format("a{0}b", random.Next());
            var subName   = "sub";
            var client    = new BusManagementClient(connection);

            var exists = await client.SubscriptionExists(topicName, subName);

            Assert.IsFalse(exists);
        }
        public void TearDown()
        {
            var client = new BusManagementClient(connection).Client;

            Task.WaitAll(
                new Task[] {
                client.DeleteQueueAsync(sendName)
                , client.DeleteQueueAsync(recieveName)
                , client.DeleteQueueAsync(sendBatchName)
            }
                );
        }
示例#6
0
        public void Setup()
        {
            var random = new Random();

            recieveName = string.Format("a{0}b", random.Next());
            subName     = "sub34";

            var client = new BusManagementClient(connection);

            client.TopicCreate(recieveName).Wait();
            client.SubscriptionCreate(recieveName, subName).Wait();
        }
        public async Task DeleteQueue()
        {
            var random = new Random();
            var name   = string.Format("a{0}b", random.Next());

            var client = new BusManagementClient(connection);
            await client.QueueCreate(name);

            await client.QueueDelete(name);

            var exists = await client.QueueExists(name);

            Assert.IsFalse(exists);
        }
        public async Task CreateTopic()
        {
            var random = new Random();
            var name   = string.Format("a{0}b", random.Next());

            var client = new BusManagementClient(connection);
            await client.TopicCreate(name);

            var exists = await client.TopicExists(name);

            Assert.IsTrue(exists);

            //cleanup
            await client.TopicDelete(name);
        }
        public void Setup()
        {
            var random = new Random();

            sendName      = string.Format("a{0}b", random.Next());
            sendBatchName = string.Format("a{0}b", random.Next());

            var client = new BusManagementClient(connection);

            Task.WaitAll(
                new Task[] {
                client.TopicCreate(sendName)
                , client.TopicCreate(sendBatchName)
            }
                );
        }
        public async Task CreateSubscription()
        {
            var random    = new Random();
            var topicName = string.Format("a{0}b", random.Next());
            var subName   = "sub";

            var client = new BusManagementClient(connection);
            await client.TopicCreate(topicName);

            await client.SubscriptionCreate(topicName, subName);

            var exists = await client.SubscriptionExists(topicName, subName);

            Assert.IsTrue(exists);

            //cleanup
            await client.TopicDelete(topicName);
        }
示例#11
0
        public void Client()
        {
            var client = new BusManagementClient(connection);

            Assert.IsNotNull(client.Client);
        }