コード例 #1
0
        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);
        }
コード例 #2
0
        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)
            }
                );
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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)
            }
                );
        }
コード例 #10
0
        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);
        }