public void It_returns_only_event_types() { var source = new AssemblyPublisherSource(Assembly.GetExecutingAssembly(), PublisherAddress.CreateFromEndpointName("Destination")); var routes = source.GenerateWithBestPracticeEnforcement(new Conventions()).ToArray(); Assert.IsFalse(routes.Any(r => r.EventType == typeof(NonMessage))); Assert.IsFalse(routes.Any(r => r.EventType == typeof(NonEvent))); }
public void It_throws_if_specified_assembly_contains_no_message_types() { var source = new AssemblyPublisherSource(typeof(string).Assembly, PublisherAddress.CreateFromEndpointName("Destination")); Assert.That(() => source.GenerateWithBestPracticeEnforcement(new Conventions()).ToArray(), Throws.Exception.Message.Contains("Cannot configure publisher for assembly")); }