mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
tried to test BoatPositionController but as it's connected to the fxml I am unsure if it is possible to test (test code is commented out) #story[426]
This commit is contained in:
@@ -42,4 +42,8 @@ public class BoatPositionController {
|
||||
positionVbox.getChildren().add(new Text(boat.getTeamName()));
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<Boat> getBoatOrder() {
|
||||
return boatOrder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package seng302.controllers;
|
||||
|
||||
import org.junit.Test;
|
||||
import seng302.models.Boat;
|
||||
import seng302.models.Event;
|
||||
import seng302.models.mark.SingleMark;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Created by ptg19 on 23/03/17.
|
||||
*/
|
||||
public class BoatPositionControllerTest {
|
||||
@Test
|
||||
public void handleEvent() throws Exception {
|
||||
// BoatPositionController controller = new BoatPositionController();
|
||||
// Boat boat1 = new Boat("boat1");
|
||||
// Boat boat2 = new Boat("boat2");
|
||||
// Boat boat3 = new Boat("boat3");
|
||||
//
|
||||
// Event event1 = new Event(1.0, boat1, new SingleMark("mark0"), new SingleMark("mark1"), 0);
|
||||
// Event event2 = new Event(1.0, boat2, new SingleMark("mark0"), new SingleMark("mark1"), 0);
|
||||
// Event event3 = new Event(1.0, boat3, new SingleMark("mark0"), new SingleMark("mark1"), 0);
|
||||
// controller.handleEvent(event1);
|
||||
// controller.handleEvent(event2);
|
||||
// controller.handleEvent(event3);
|
||||
// assertEquals(controller.getBoatOrder(), new ArrayList<Boat>(Arrays.asList(boat1, boat2, boat3)));
|
||||
|
||||
|
||||
// Event event4 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 0);
|
||||
// Event event5 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 1);
|
||||
// Event event6 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 1);
|
||||
// Event event7 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 1);
|
||||
// Event event8 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 1);
|
||||
// Event event9 = new Event(1.0, boat3, new SingleMark("mark1"), new SingleMark("mark2"), 1);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user