public void MakeCurrent() { RemoteMouse.MakeCurrent(); RemoteKeyboard.MakeCurrent(); RemoteTouchscreen.MakeCurrent(); RemoteGamepad.MakeCurrent(); }
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); }
private InputPacketsAnalyser CreateAnalyser(RemoteKeyboard keyboard) { var analyser = new InputPacketsAnalyser(); analyser.SetActiveKeyboard(keyboard); return analyser; }
public void RunCoverage() { var keyboard = new RemoteKeyboard(); keyboard.Run(); }
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(); } }