Added tests for sounds and modified the transparency for the chat history window.

#story[1245]
This commit is contained in:
Kusal Ekanayake
2017-09-12 18:11:32 +12:00
parent e518d13fd5
commit c8dc448a52
6 changed files with 72 additions and 8 deletions
@@ -0,0 +1,25 @@
package seng302.utilities;
import static org.junit.Assert.assertEquals;
import org.junit.Assert;
import org.junit.Test;
/**
* Used to test the muting functionality of the sounds util
* Created by kre39 on 12/09/17.
*/
public class SoundsTest {
@Test
public void testMutes() throws Exception {
Sounds.setMutes();
Assert.assertFalse(Sounds.isMusicMuted());
Assert.assertFalse(Sounds.isSoundEffectsMuted());
Sounds.toggleAllSounds();
Sounds.toggleMuteEffects();
Sounds.toggleMuteMusic();
Assert.assertFalse(Sounds.isMusicMuted());
Assert.assertFalse(Sounds.isSoundEffectsMuted());
}
}
+10 -2
View File
@@ -43,8 +43,11 @@ public class SendChatSteps {
ie.printStackTrace();
}
mst.startGame();
Thread.sleep(200);
}
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
ie.printStackTrace();
} }
@When("^the first client has sent the message \"([^\"]*)\"$")
@@ -54,6 +57,11 @@ public class SendChatSteps {
@Then("^the other client should receive the message \"([^\"]*)\"$")
public void the_other_client_should_receive_the_message(String arg1) throws Throwable {
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
Object[] packets = host.getPacketQueue().toArray();
Pair<Integer, String> message = StreamParser.extractChatterText((StreamPacket) packets[packets.length - 1]);
Assert.assertEquals("[time_prefix] <name_prefix> " + arg1, message.getValue());