public void Without_best_practice_enforcement_it_throws_if_specified_assembly_contains_only_commands() { //Enforce artificial conventions to make sure the is a single command (but no messages) in an assembly var conventionBuilder = new ConventionsBuilder(new SettingsHolder()); conventionBuilder.DefiningCommandsAs(t => t == typeof(string)); var source = new AssemblyPublisherSource(typeof(string).Assembly, PublisherAddress.CreateFromEndpointName("Destination")); Assert.That(() => source.GenerateWithoutBestPracticeEnforcement(conventionBuilder.Conventions).ToArray(), Throws.Exception.Message.Contains("Cannot configure publisher for assembly")); }