Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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();
        }