mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Refactored Boat class to better fit the MVC model by moving all GUI parts to BoatPolygon. Changed the way animation works so that it will work with a constantly updated set of lats and lons.
TODO - Change Mark class to no longer store XY pixel data. TODO - Add in a timer force updates boat position if a packet has not been recieved for a while. #story30b #story30c #implement #refactor
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package seng302;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import seng302.models.Boat;
|
||||
import seng302.models.BoatPolygon;
|
||||
import seng302.models.Colors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -16,30 +19,13 @@ import static org.junit.Assert.assertEquals;
|
||||
* Created by ryan_ on 16/03/2017.
|
||||
*/
|
||||
public class ColorsTest {
|
||||
//@Test
|
||||
|
||||
@Test
|
||||
public void testNextColor() {
|
||||
List<Boat> boats = new ArrayList<>();
|
||||
boats.add(new Boat("Team 1"));
|
||||
boats.add(new Boat("Team 2"));
|
||||
boats.add(new Boat("Team 3"));
|
||||
boats.add(new Boat("Team 4"));
|
||||
boats.add(new Boat("Team 5"));
|
||||
boats.add(new Boat("Team 6"));
|
||||
|
||||
int count = 0;
|
||||
List<Color> enumColors = new ArrayList<>();
|
||||
while (count < 6) {
|
||||
Color color = Colors.getColor();
|
||||
enumColors.add(color);
|
||||
count++;
|
||||
Color expectedColors[] = {Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.BLUE, Color.PURPLE};
|
||||
for (int i = 0; i<6; i++)
|
||||
{
|
||||
Assert.assertEquals(expectedColors[i], Colors.getColor());
|
||||
}
|
||||
|
||||
List<Color> boatColors = new ArrayList<>();
|
||||
for (Boat boat : boats) {
|
||||
Color color = boat.getColor();
|
||||
boatColors.add(color);
|
||||
}
|
||||
|
||||
assertEquals(enumColors, boatColors);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user