public void It_matches_namespace_in_case_insensitive_way() { var source = new NamespacePublisherSource(Assembly.GetExecutingAssembly(), "NServiceBus.Core.Tests.Routing.NAMESPACEpublisherSOURCEtest", PublisherAddress.CreateFromEndpointName("Destination")); var routes = source.GenerateWithBestPracticeEnforcement(new Conventions()).ToArray(); var routedTypes = routes.Select(r => r.EventType); CollectionAssert.Contains(routedTypes, typeof(Event)); }
public void It_returns_only_types_from_specified_namespace() { var source = new NamespacePublisherSource(Assembly.GetExecutingAssembly(), "NServiceBus.Core.Tests.Routing.NamespacePublisherSourceTest", PublisherAddress.CreateFromEndpointName("Destination")); var routes = source.GenerateWithBestPracticeEnforcement(new Conventions()); var routedTypes = routes.Select(r => r.EventType).ToArray(); CollectionAssert.Contains(routedTypes, typeof(Event)); CollectionAssert.DoesNotContain(routedTypes, typeof(ExcludedEvent)); }
public void It_throws_if_specified_namespace_contains_no_message_types() { var source = new NamespacePublisherSource(Assembly.GetExecutingAssembly(), "NServiceBus.Core.Tests.Routing.NamespacePublisherSourceTest.NoMessages", PublisherAddress.CreateFromEndpointName("Destination")); Assert.That(() => source.GenerateWithBestPracticeEnforcement(new Conventions()).ToArray(), Throws.Exception.Message.Contains("Cannot configure publisher for namespace")); }