public void MakeCurrent()
 {
     RemoteMouse.MakeCurrent();
     RemoteKeyboard.MakeCurrent();
     RemoteTouchscreen.MakeCurrent();
     RemoteGamepad.MakeCurrent();
 }
예제 #2
0
        public void HandleNewPacket()
        {
            var keyboard = new RemoteKeyboard();
            InputPacketsAnalyser analyser = CreateAnalyser(keyboard);
            analyser.HandleNewMessage(CreateTestPacket());

            Assert.True(keyboard.IsAvailable);
            Assert.AreEqual(keyboard.GetKeyState(Key.BackSpace), State.JustPressed);
            Assert.AreEqual(keyboard.GetKeyState(Key.CursorDown), State.IsPressed);
        }
예제 #3
0
 private InputPacketsAnalyser CreateAnalyser(RemoteKeyboard keyboard)
 {
     var analyser = new InputPacketsAnalyser();
     analyser.SetActiveKeyboard(keyboard);
     return analyser;
 }
예제 #4
0
 public void RunCoverage()
 {
     var keyboard = new RemoteKeyboard();
     keyboard.Run();
 }
예제 #5
0
        private void RunTestCodeWithServerAndClientConnection(TestCodeDelegate deleg)
        {
            var mouse = new RemoteMouse();
            var touch = new RemoteTouch();
            var keyboard = new RemoteKeyboard();
            var analyser = new InputPacketsAnalyser();
            analyser.SetActiveMouse(mouse);
            analyser.SetActiveTouch(touch);
            analyser.SetActiveKeyboard(keyboard);
            var server = new RemoteServer(analyser, TestPort);
            RemoteClient client = CreateTestClient();
            Task connection = client.ConnectToServerAsync();
            connection.Wait();

            var data = new TestObjects
            { Client = client, Mouse = mouse, Touch = touch, Keyboard = keyboard };
            server.Received += delegate
            {
                data.NumberOfReceivedMessages++;
            };

            try
            {
                if (deleg != null)
                    deleg(data);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
            finally
            {
                client.Dispose();
                server.Dispose();
            }
        }