public void ReverseProxyConventionBuilder_ConfigureWithProxyAndCluster_Works()
        {
            var configured = false;

            var conventions = new List <Action <EndpointBuilder> >();
            var builder     = new ReverseProxyConventionBuilder(conventions);

            builder.ConfigureEndpoints((builder, proxy, cluster) =>
            {
                configured = true;
            });

            var proxyRoute      = new ProxyRoute();
            var cluster         = new Cluster();
            var endpointBuilder = CreateEndpointBuilder(proxyRoute, cluster);

            var action = Assert.Single(conventions);

            action(endpointBuilder);

            Assert.True(configured);
        }
Esempio n. 2
0
        public void ReverseProxyConventionBuilder_Configure_Works()
        {
            var configured = false;

            var conventions = new List <Action <EndpointBuilder> >();
            var builder     = new ReverseProxyConventionBuilder(conventions);

            builder.ConfigureEndpoints(builder =>
            {
                configured = true;
            });

            var routeConfig     = new RouteConfig();
            var cluster         = new ClusterConfig();
            var endpointBuilder = CreateEndpointBuilder(routeConfig, cluster);

            var action = Assert.Single(conventions);

            action(endpointBuilder);

            Assert.True(configured);
        }