public void OnRightTest() { var eventLoop = new CursorEventLoop(); var game = new GameWithCursor(); int position = Console.CursorLeft; game.OnRight(new object(), new EventArgs()); Assert.IsTrue(position + 1 == Console.CursorLeft); }
/// <summary> /// Сборка для игры /// </summary> /// <param name="args"></param> static void Main(string[] args) { var eventLoop = new CursorEventLoop(); var game = new GameWithCursor(); eventLoop.LeftHandler += game.OnLeft; eventLoop.RightHandler += game.OnRight; eventLoop.UpHandler += game.OnUp; eventLoop.DownHandler += game.OnDown; eventLoop.Run(); }