mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
6935bd514e
#story[818]
42 lines
908 B
Java
42 lines
908 B
Java
package seng302;
|
|
|
|
import org.junit.Test;
|
|
import seng302.models.Race;
|
|
import seng302.models.Yacht;
|
|
|
|
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() {
|
|
Yacht boat1 = new Yacht("Team 1");
|
|
Yacht boat2 = new Yacht("Team 2");
|
|
|
|
Race race = new Race();
|
|
race.addBoat(boat1);
|
|
race.addBoat(boat2);
|
|
|
|
assertEquals(Array.getLength(race.getBoats()), 2);
|
|
}
|
|
|
|
@Test
|
|
public void testGetShuffledBoats(){
|
|
Yacht boat1 = new Yacht("Team 1");
|
|
Yacht boat2 = new Yacht("Team 2");
|
|
|
|
Race race = new Race();
|
|
race.addBoat(boat1);
|
|
race.addBoat(boat2);
|
|
|
|
assertEquals(Array.getLength(race.getShuffledBoats()), 2);
|
|
}
|
|
}
|