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>()); }
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); }
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); }
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); }