public void TurnTwoTime() { var shape = new TetriminoI(); Call.Action(4, () => shape.Turn()); Check.That(shape).IsEquivalentTo((1, 1), (1, 2), (1, 3), (1, 4)); }
public void TurnOneTime(int start, FakeShape expected) { var shape = new TetriminoI(start); shape.Turn(); Check.That(shape).IsEquivalentTo(expected); }
public void MoveLeft(int actionCount, int col1, int col2, int col3, int col4) { var shape = new TetriminoI(7); Call.Action(actionCount, () => shape.MoveLeft()); Check.That(shape).IsEquivalentTo((1, col1), (1, col2), (1, col3), (1, col4)); }
public void TurnCorrectlyWhenReachedLeftSideInVerticalPosition() { var shape = new TetriminoI(); shape.Turn(); Call.Action(2, () => shape.MoveLeft()); shape.Turn(); Check.That(shape).IsEquivalentTo((1, 1), (1, 2), (1, 3), (1, 4)); }
public void TurnCorrectlyWhenReachedRightSideInVerticalPosition() { var shape = new TetriminoI(9); shape.Turn(); Call.Action(5, () => shape.MoveRight()); shape.Turn(); Check.That(shape).IsEquivalentTo((1, 9), (1, 10), (1, 11), (1, 12)); }
public void DontTurnWhenReachedBottomInAnyPosition(int bottomPadding) { var shape = new TetriminoI(); var height = Game.Height - bottomPadding; Call.Action(height - 1, () => shape.MoveDown()); shape.Turn(); Check.That(shape).IsEquivalentTo((height, 1), (height, 2), (height, 3), (height, 4)); }
public void DontBugWhenTryingToChangePositionTwiceOnBottom(int bottomPadding) { var shape = new TetriminoI(); var height = Game.Height - bottomPadding; Call.Action(height - 1, () => shape.MoveDown()); shape.Turn(); shape.Turn(); Check.That(shape).IsEquivalentTo((height, 1), (height, 2), (height, 3), (height, 4)); }
public void RemoveLineSeparated() { var bottomStack = new BottomStack(); var t1_1 = new TetriminoT(1); Call.Action(2, () => t1_1.Turn()); var t1_2 = new TetriminoT(4); Call.Action(2, () => t1_2.Turn()); var t1_3 = new TetriminoT(7); Call.Action(2, () => t1_3.Turn()); var o1_1 = new TetriminoO(10); var i3_1 = new TetriminoI(1); var i3_2 = new TetriminoI(5); var l3_1 = new TetriminoJ(9); Call.Action(2, () => l3_1.Turn()); var i4_1 = new TetriminoI(1); var i4_2 = new TetriminoI(5); var o4_1 = new TetriminoO(10); var lastBar = new TetriminoI(); bottomStack.PushBottom(t1_1); bottomStack.PushBottom(t1_2); bottomStack.PushBottom(t1_3); bottomStack.PushBottom(o1_1); bottomStack.PushBottom(i3_1); bottomStack.PushBottom(i3_2); bottomStack.PushBottom(l3_1); bottomStack.PushBottom(i4_1); bottomStack.PushBottom(i4_2); bottomStack.PushBottom(o4_1); lastBar.Turn(); Call.Action(12, () => lastBar.MoveRight()); bottomStack.PushBottom(lastBar); bottomStack.CompletedLineCount.Should().Be(3); bottomStack.RemoveCompletedLines(); bottomStack.Count().Should().Be(8); Check.That(bottomStack).IsEquivalentTo((24, 2), (24, 5), (24, 8), (24, 10), (24, 11), (24, 12), (23, 10), (23, 11)); }
public void BeInitialized() { var shape = new TetriminoI(); Check.That(shape).IsEquivalentTo((1, 1), (1, 2), (1, 3), (1, 4)); }