예제 #1
0
        public void RecoverableSession_Ok()
        {
            IPipeline <ClientActionContext> pipeline =
                ClientConfiguration.ProxyBuilder()
                .Url("http://localhost:8080")
                .Recoverable(45, TimeSpan.FromSeconds(8))
                .UseSession()
                .BuildPipeline();

            Assert.NotNull(pipeline.Find <SessionMiddleware>());
            Assert.NotNull(pipeline.Find <RetryRequestMiddleware>());
        }
예제 #2
0
        public void Timeout_Ok()
        {
            IPipeline <ClientActionContext> pipeline =
                ClientConfiguration.ProxyBuilder().Url("http://localhost:8080").Timeout(TimeSpan.FromSeconds(99))
                .BuildPipeline();

            Assert.Equal(TimeSpan.FromSeconds(99), pipeline.Find <CommunicationMiddleware>().ResponseTimeout);
        }
예제 #3
0
        public void TimeoutProvider_Ok()
        {
            var provider = new TimeoutProvider();

            IPipeline <ClientActionContext> pipeline =
                ClientConfiguration.ProxyBuilder().Url("http://localhost:8080").Timeout(provider)
                .BuildPipeline();

            Assert.Equal(provider, pipeline.Find <CommunicationMiddleware>().TimeoutProvider);
        }
예제 #4
0
        public void Session_Ok(bool useDistributedSession)
        {
            IPipeline <ClientActionContext> pipeline =
                ClientConfiguration.ProxyBuilder()
                .Url("http://localhost:8080")
                .UseSession(useDistributedSession)
                .BuildPipeline();

            var middleware = pipeline.Find <SessionMiddleware>();

            Assert.NotNull(middleware);
            Assert.Equal(useDistributedSession, middleware.UseDistributedSession);
        }