public void TestGetUnknownEndpointDelegate()
        {
            var provider = new TopicBasedEndpointProvider(Enumerable.Empty <HandlerDescriptor>());

            Assert.Throws <ArgumentException>(
                () => provider.GetEndpointDelegate(new ExternalTask("test", "test", "topic1"))
                );
        }
        public void TestGetKnownEndpointDelegate()
        {
            Task FakeHandlerDelegate(IExternalTaskContext context) => Task.CompletedTask;

            var provider = new TopicBasedEndpointProvider(new[]
            {
                new HandlerDescriptor(FakeHandlerDelegate, new HandlerMetadata(new[] { "topic1" }))
            });

            var handlerDelegate = provider.GetEndpointDelegate(new ExternalTask("test", "test", "topic1"));

            Assert.NotNull(handlerDelegate);
        }