summaryrefslogtreecommitdiff
path: root/src/tetris/tests/piece/IPieceTest.java
blob: 031b1e803fd2af13e112f03031738c3a97a10632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Jesse Morgan <jesterpm@u.washington.edu>
 * 
 * TCSS 305 Ð Autumn 2009 Tetris Project 17 November 2009
 */

package tetris.tests.piece;

import tetris.piece.IPiece;
import tetris.piece.TetrisPiece;

/**
 * JUnit Test for the I Piece.
 * 
 * @author Jesse Morgan <jesterpm@u.washington.edu>
 * @version 1.0 17 November 2009
 */
public class IPieceTest extends TetrisPieceTest {
  /**
   * Array of the string representations of various rotations.
   */
  private static final String[] ROTATION_STRINGS =
      new String[] {"....\n....\nXXXX\n....", ".X..\n.X..\n.X..\n.X.."};

  @Override
  protected int[] getOriginalPoints() {
    return new int[] {0, 2, 1, 2, 2, 2, 3, 2}; // Copied from the class.
  }

  @Override
  protected TetrisPiece getPiece(final int the_x, final int the_y) {
    return new IPiece(the_x, the_y);
  }

  @Override
  protected String[] getRotationStrings() {
    return ROTATION_STRINGS.clone();
  }
}