public void TetrisAdvanceTime() { _model.NewGame(); var pos1 = _model.table.ShapeCordX; _model.AdvanceTime(); Assert.IsTrue(_model.getTime() == 1); Assert.AreEqual(pos1 + 1, _model.table.ShapeCordX); var pos2 = _model.table.ShapeCordY; _model.GoLeft(); Assert.IsTrue(_model.getTime() == 1); Assert.AreEqual(pos2 - 1, _model.table.ShapeCordY); _model.GoRight(); Assert.IsTrue(_model.getTime() == 1); Assert.AreEqual(pos2, _model.table.ShapeCordY); _model.GoRight(); Assert.IsTrue(_model.getTime() == 1); Assert.AreEqual(pos2 + 1, _model.table.ShapeCordY); _model.AdvanceTime(); Assert.IsTrue(_model.getTime() == 2); Assert.AreEqual(pos1 + 2, _model.table.ShapeCordX); _model.AdvanceTime(); Assert.IsTrue(_model.getTime() == 3); Assert.AreEqual(pos1 + 3, _model.table.ShapeCordX); }
private void ViewModel_Right(object sender, EventArgs e) { if (_timerActive) { _model.GoRight(); } }