mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
550812d8e1
At this point the javafx is not tied to the old code in any way #story[377]
42 lines
899 B
Java
42 lines
899 B
Java
package seng302;
|
|
|
|
import org.junit.Test;
|
|
import seng302.models.Boat;
|
|
import seng302.models.Race;
|
|
|
|
import java.lang.reflect.Array;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
/**
|
|
* Unit test for the Race class.
|
|
*/
|
|
public class RaceTest {
|
|
/**
|
|
* Test that all boats were added to the race
|
|
*/
|
|
@Test
|
|
public void testAddingBoatsToRace() {
|
|
Boat boat1 = new Boat("Team 1");
|
|
Boat boat2 = new Boat("Team 2");
|
|
|
|
Race race = new Race();
|
|
race.addBoat(boat1);
|
|
race.addBoat(boat2);
|
|
|
|
assertEquals(Array.getLength(race.getBoats()), 2);
|
|
}
|
|
|
|
@Test
|
|
public void testGetShuffledBoats(){
|
|
Boat boat1 = new Boat("Team 1");
|
|
Boat boat2 = new Boat("Team 2");
|
|
|
|
Race race = new Race();
|
|
race.addBoat(boat1);
|
|
race.addBoat(boat2);
|
|
|
|
assertEquals(Array.getLength(race.getShuffledBoats()), 2);
|
|
}
|
|
}
|