mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Working cucumber tests for sails toggle.
When sails in will send a sails out message when sails out will send a sails in message and then checks for the new status of the sail #story[1111]
This commit is contained in:
@@ -34,8 +34,12 @@ public class ToggleSailSteps {
|
||||
mst = new MainServerThread();
|
||||
client = new ClientToServerThread("localhost", 4942);
|
||||
GameState.setCurrentStage(GameStages.RACING);
|
||||
Thread.sleep(200); // Sleep needed to help the threads all be up to speed with each other
|
||||
Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
||||
Assert.assertFalse(yacht.getSailIn());
|
||||
}
|
||||
|
||||
|
||||
@When("^the user has pressed \"([^\"]*)\"$")
|
||||
public void the_user_has_pressed(String arg1) throws Throwable {
|
||||
startTime = System.currentTimeMillis();
|
||||
@@ -50,7 +54,12 @@ public class ToggleSailSteps {
|
||||
|
||||
@Then("^the sails are \"([^\"]*)\"$")
|
||||
public void the_sails_are(String arg1) throws Throwable {
|
||||
//Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
||||
//Assert.assertTrue(yacht.getSailIn());
|
||||
Thread.sleep(200); // Sleep needed to help the threads all be up to speed with each other
|
||||
Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
||||
if (arg1 == "in") {
|
||||
Assert.assertTrue(yacht.getSailIn());
|
||||
} else {
|
||||
Assert.assertFalse(yacht.getSailIn());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user