/// <summary>
        ///     The server definitions - exchanges, queues, bindings, users, virtual hosts, permissions.
        ///     Everything apart from messages.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static Definitions GetDefinitions(
            [NotNull] this IManagementClient source,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetDefinitionsAsync(cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }
示例#2
0
        public async Task Should_get_definitions()
        {
            var definitions = await managementClient.GetDefinitionsAsync().ConfigureAwait(false);

            definitions.RabbitVersion[0].ShouldEqual('3');
        }