Beispiel #1
0
        public static QueueBuilder Durable(string name)
        {
            var builder = new QueueBuilder(name);

            builder._durable = true;
            return(builder);
        }
        public void BuildsNonDurableQueue()
        {
            var queue = QueueBuilder.NonDurable("name").Build();

            Assert.False(queue.IsDurable);
            Assert.Equal("name", queue.QueueName);
        }
        public void AddsArguments()
        {
            var queue = QueueBuilder.Durable("name")
                        .WithArgument("key1", "value1")
                        .WithArgument("key2", "value2")
                        .Build();

            var args = queue.Arguments;

            Assert.Equal("value1", args["key1"]);
            Assert.Equal("value2", args["key2"]);
        }
        public void AddsMultipleArgumentsAtOnce()
        {
            var arguments = new Dictionary <string, object>
            {
                { "key1", "value1" },
                { "key2", "value2" }
            };

            var queue = QueueBuilder.Durable("name").WithArguments(arguments).Build();
            var args  = queue.Arguments;

            Assert.Equal("value1", args["key1"]);
            Assert.Equal("value2", args["key2"]);
        }
        public void BuildsExclusiveQueue()
        {
            var queue = QueueBuilder.Durable("name").Exclusive().Build();

            Assert.True(queue.IsExclusive);
        }
        public void BuildsAutoDeleteQueue()
        {
            var queue = QueueBuilder.Durable("name").AutoDelete().Build();

            Assert.True(queue.IsAutoDelete);
        }