Beispiel #1
0
        public void TestRequestChat()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();

            VisitSessionService.Provider = provider;
            MyChatProvider pp = new MyChatProvider();

            ChatService.Provider = pp;
            VisitSession v = new VisitSession();

            v.SessionId = "aaaaa";
            VisitSessionService.NewSession(v);
            Chat ch = new Chat();

            ch.AccountId  = "2";
            ch.ChatId     = "mfdsa";
            ch.CreateTime = DateTime.Now;
            ch.Status     = LiveSupport.LiveSupportModel.ChatStatus.Requested;
            ch.VisitorId  = "bbb";
            //  VisitSessionService.RequestChat(ch);
            Assert.AreEqual(0, ChatService.chats.Count);
            //Chat ch1 = new Chat();
            //ch.AccountId = "2";
            //ch1.ChatId = "aaaaa";
            //ch.VisitorId = "bbb";
            //VisitSessionService.RequestChat(ch1);
            //Assert.AreEqual(1, ChatService.chats.Count);
        }
 public void TestNewSession()
 {
     MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();
     VisitSession v = new VisitSession();
     VisitSessionService.Provider = provider;
     VisitSessionService.NewSession(v);
     Assert.AreEqual(1, provider.Sessions.Count);
     VisitSession vv = new VisitSession();
     vv.SessionId = v.SessionId;
     VisitSessionService.NewSession(vv);
     Assert.AreEqual(1, provider.Sessions.Count);
 }
        public void TestNewSessionMaxNum()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();
            VisitSessionService.Provider = provider;
            for (int i = 0; i < 210; i++)
            {
                VisitSession s = new VisitSession();
                s.Status = VisitSessionStatus.Leave;
                VisitSessionService.NewSession(s);
            }

            Assert.AreEqual(200, VisitSessionService.Sessions.Count);
        }
Beispiel #4
0
        public void TestNewSessionMaxNum()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();

            VisitSessionService.Provider = provider;
            for (int i = 0; i < 210; i++)
            {
                VisitSession s = new VisitSession();
                s.Status = VisitSessionStatus.Leave;
                VisitSessionService.NewSession(s);
            }

            Assert.AreEqual(200, VisitSessionService.Sessions.Count);
        }
Beispiel #5
0
        public void TestNewSession()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();
            VisitSession v = new VisitSession();

            VisitSessionService.Provider = provider;
            VisitSessionService.NewSession(v);
            Assert.AreEqual(1, provider.Sessions.Count);
            VisitSession vv = new VisitSession();

            vv.SessionId = v.SessionId;
            VisitSessionService.NewSession(vv);
            Assert.AreEqual(1, provider.Sessions.Count);
        }
        public void TestGetSessionById()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();
            VisitSessionService.Provider = provider;
            VisitSession v = new VisitSession();
            v.SessionId="aaaaa";
            VisitSessionService.NewSession(v);
            Assert.AreEqual(v,VisitSessionService.GetSessionById(v.SessionId));
            Assert.AreEqual(1, VisitSessionService.Sessions.Count);
            for (int i = 0; i < 20; i++)
            {
               VisitSession vv = new VisitSession();
               vv.SessionId = "aaaaa";
               VisitSessionService.NewSession(vv);
            }

            Assert.AreEqual(1, VisitSessionService.Sessions.Count);
        }
Beispiel #7
0
        public void TestGetSessionById()
        {
            MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();

            VisitSessionService.Provider = provider;
            VisitSession v = new VisitSession();

            v.SessionId = "aaaaa";
            VisitSessionService.NewSession(v);
            Assert.AreEqual(v, VisitSessionService.GetSessionById(v.SessionId));
            Assert.AreEqual(1, VisitSessionService.Sessions.Count);
            for (int i = 0; i < 20; i++)
            {
                VisitSession vv = new VisitSession();
                vv.SessionId = "aaaaa";
                VisitSessionService.NewSession(vv);
            }

            Assert.AreEqual(1, VisitSessionService.Sessions.Count);
        }
 public void TestRequestChat()
 {
     MyVisitSessionServiceProvider provider = new MyVisitSessionServiceProvider();
     VisitSessionService.Provider = provider;
     MyChatProvider pp = new MyChatProvider();
     ChatService.Provider = pp;
     VisitSession v = new VisitSession();
     v.SessionId = "aaaaa";
     VisitSessionService.NewSession(v);
     Chat ch= new Chat();
     ch.AccountId = "2";
     ch.ChatId = "mfdsa";
     ch.CreateTime = DateTime.Now;
     ch.Status = LiveSupport.LiveSupportModel.ChatStatus.Requested;
     ch.VisitorId = "bbb";
       //  VisitSessionService.RequestChat(ch);
     Assert.AreEqual(0, ChatService.chats.Count);
     //Chat ch1 = new Chat();
     //ch.AccountId = "2";
     //ch1.ChatId = "aaaaa";
     //ch.VisitorId = "bbb";
     //VisitSessionService.RequestChat(ch1);
     //Assert.AreEqual(1, ChatService.chats.Count);
 }