public async Task SessionNotFound_RetriesEnabled_EnsureNewSession() { var pipeline = CreatePipeline(1); var session = pipeline.Find <SessionMiddleware>(); var client = GetProxy(pipeline); client.GetState(); string sessionId = session.GetSession(client).SessionId; SessionInstanceProvider instanceProvider = InstanceProvider; await Factory.DestroyAsync(sessionId); client.GetState(); }
public async Task CloseSession_EnsureInstanceReleasedOnServer() { var pipeline = CreatePipeline(); var session = pipeline.Find <SessionMiddleware>(); var client = GetProxy(pipeline); client.GetState(); string sessionId = session.GetSession(client).SessionId; (client as IDisposable).Dispose(); SessionInstanceProvider instanceProvider = InstanceProvider; Assert.False(await Factory.DestroyAsync(sessionId)); }
public async Task Async_SessionNotFound_RetriesEnabled_EnsureNewSession() { Mock <IErrorHandling> errorHandling = new Mock <IErrorHandling>(); errorHandling.Setup(e => e.Handle(It.IsAny <ClientActionContext>(), It.IsAny <Exception>())) .Returns(ErrorHandlingResult.Recover); var pipeline = CreatePipeline(1, errorHandling.Object); var session = pipeline.Find <SessionMiddleware>(); var client = GetProxy(pipeline); await client.GetStateAsync(); string sessionId = session.GetSession(client).SessionId; SessionInstanceProvider instanceProvider = InstanceProvider; await Factory.DestroyAsync(sessionId); await client.GetStateAsync(); }