public void SetConsumerName_Works(Type eventType,
                                          Type consumerType,
                                          bool useFullTypeNames,
                                          string prefix,
                                          bool suffixEventName,
                                          ConsumerNameSource consumerNameSource,
                                          NamingConvention namingConvention,
                                          string expected)
        {
            var environment = new FakeHostEnvironment("app1");
            var options     = new EventBusOptions {
            };

            options.Naming.Convention         = namingConvention;
            options.Naming.UseFullTypeNames   = useFullTypeNames;
            options.Naming.ConsumerNameSource = consumerNameSource;
            options.Naming.ConsumerNamePrefix = prefix;
            options.Naming.SuffixConsumerName = suffixEventName;

            var registration = new EventRegistration(eventType);

            registration.Consumers.Add(new EventConsumerRegistration(consumerType));

            var creg = Assert.Single(registration.Consumers);

            registration.SetEventName(options.Naming)
            .SetConsumerNames(options.Naming, environment);
            Assert.Equal(expected, creg.ConsumerName);
        }
        public void GetApplicationName_Works(string applicationName, NamingConvention convention, string scope, string expected)
        {
            var options = new EventBusNamingOptions {
                Scope = scope, Convention = convention,
            };
            var environment = new FakeHostEnvironment(applicationName);
            var actual      = options.GetApplicationName(environment);

            Assert.Equal(expected, actual);
        }