コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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"));
        }
コード例 #6
0
        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"));
        }