Esempio n. 1
0
        public ServerEventsTesting()
        {
            var page = new MyPage();

            _document   = new Document(page, BaseModeController.DefaultKeepAliveInterval);
            _controller = _document.GetServerEventsController();
            _controller.ServerEventsOn();
            _socket = new Mock <WebSocket>();
        }
Esempio n. 2
0
        public void ServerEventCases()
        {
            var socket = new Mock <WebSocket>();
            var status = ServerEventsController.CalculateServerEventsStatus(false, socket.Object);

            Assert.Equal(ServerEventsStatus.Disabled, status);
            status = ServerEventsController.CalculateServerEventsStatus(true, null);
            Assert.Equal(ServerEventsStatus.Connecting, status);
            status = ServerEventsController.CalculateServerEventsStatus(true, socket.Object);
            Assert.Equal(ServerEventsStatus.Enabled, status);
        }