@Test public void testFieldWithRandom() { fillGameField(16); long[] fieldValues = gameField.getArray(); for (int i = 0; i < 16; i++) { assertEquals(fieldValues[i] == 2 || fieldValues[i] == 4, true); } }
private void fillGameField(int count) { for (int i = 0; i < count; i++) gameField.fillEmptyCell(); }