示例#1
0
        public async Task Should_be_able_to_get_all_the_bindings_for_a_queue()
        {
            var queue = await CreateTestQueue(testQueue).ConfigureAwait(false);

            var bindings = await managementClient.GetBindingsForQueueAsync(queue).ConfigureAwait(false);

            Assert.NotEmpty(bindings.ToList());
        }
        /// <summary>
        ///     A list of all bindings on a given queue.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="queue"></param>
        /// <param name="cancellationToken"></param>
        public static IReadOnlyList <Binding> GetBindingsForQueue(
            [NotNull] this IManagementClient source,
            [NotNull] Queue queue,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetBindingsForQueueAsync(queue, cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }