示例#1
0
        public void SessionItemTest()
        {
            service.Register("12345", "Jacky", "127.0.0.1", "abc");
            service.Activate("12345");

            object key1 = new object();

            service.CurrentSession["key1"] = key1;
            Assert.AreEqual(service.CurrentSession["key1"], key1);

            object key2 = new object();

            service.CurrentSession["key2"] = key2;
            Assert.AreEqual(service.CurrentSession["key2"], key2);

            service.CurrentSession.Remove("key2");
            Assert.IsNull(service.CurrentSession["key2"]);

            service.CurrentSession.RemoveAll();
            Assert.IsNull(service.CurrentSession["key1"]);

            service.UnloadSession("12345");
        }
示例#2
0
        /// <summary>
        /// Activites the sessioin.
        /// </summary>
        /// <param name="sessionId">The session ID.</param>
        public void ActiviteSessioin(string sessionId)
        {
            ISessionService service = kernel[typeof(ISessionService)] as ISessionService;

            service.Activate(sessionId);
        }