Пример #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);
        }
Пример #2
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);
 }
Пример #3
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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #6
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);
        }
Пример #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);
        }
Пример #8
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);
 }