public void Loop_ReceivedKey_CallScreenInputWithKey() { _keyReceiver.ReceiveKey("Any key"); _engine.Loop(); int dTime = 1000 / _fps; _screenMock.Verify(screen => screen.Input("Any key", dTime), Times.Once()); }
public void Start() { _thread = new Thread(() => { while (true) { ConsoleKeyInfo keyInput = System.Console.ReadKey(true); _keyReceiver.ReceiveKey(keyInput.Key.ToString()); } }); _thread.IsBackground = true; _thread.Start(); }