Skip to content

Commit c342bad

Browse files
committed
add the test code
1 parent b458227 commit c342bad

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"playerPosition":{"x":1.2306137,"y":7.9963317},"playerHealth":644,"playerGold":50,"timestamp":1758105919553,"towers":[{"type":"dino","width":2,"height":2,"position":{"x":11,"y":6.5},"health":1,"damage":8,"range":2,"attackCooldown":0.8,"attackTimer":5.6833525},{"type":"dino","width":2,"height":2,"position":{"x":11,"y":6.5},"health":1,"damage":8,"range":2,"attackCooldown":0.8,"attackTimer":5.6833525},{"type":"bone","width":2,"height":2,"position":{"x":1.5,"y":3},"health":1,"damage":5,"range":3,"attackCooldown":1,"attackTimer":3.6499972},{"type":"bone","width":2,"height":2,"position":{"x":1.5,"y":3},"health":1,"damage":5,"range":3,"attackCooldown":1,"attackTimer":3.6499972},{"type":"bone","width":2,"height":2,"position":{"x":3,"y":3.5},"health":1,"damage":5,"range":3,"attackCooldown":1,"attackTimer":0.6000001},{"type":"bone","width":2,"height":2,"position":{"x":3,"y":3.5},"health":1,"damage":5,"range":3,"attackCooldown":1,"attackTimer":0.6000001}],"enemies":[{"type":"drone","position":{"x":1.0878214,"y":7.580058},"health":25},{"type":"boss","position":{"x":1.6928216,"y":6.936264},"health":143},{"type":"tank","position":{"x":3.9022415,"y":8.181043},"health":150},{"type":"grunt","position":{"x":4.171674,"y":5.18501},"health":45},{"type":"grunt","position":{"x":4.4241853,"y":4.3020663},"health":75},{"type":"tank","position":{"x":5.4707465,"y":6.98153},"health":100}]}
1+
{}

source/core/src/test/com/csse3200/game/integration/AudioIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void shouldIntegrateBackgroundMusicFlow() {
6161
audioService.registerMusic("bgm", "bgm.mp3");
6262

6363
musicEntity.getEvents().trigger("playMusic", "bgm");
64-
verify(mockMusic).setVolume(0.5f);
64+
verify(mockMusic).setVolume(audioService.getMusicVolume());
6565
verify(mockMusic).setLooping(true);
6666
verify(mockMusic).play();
6767

@@ -82,7 +82,7 @@ void shouldIntegrateSoundEffectFlow() {
8282
audioService.registerSound("effect", "effect.ogg");
8383

8484
soundEntity.getEvents().trigger("playSound", "effect");
85-
verify(mockSound).play(0.5f);
85+
verify(mockSound).play(audioService.getSoundVolume());
8686

8787
soundEntity.getEvents().trigger("playSoundWithVolume", "effect", 0.8f);
8888
verify(mockSound).play(0.8f);

source/core/src/test/com/csse3200/game/services/AudioServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void shouldPlayMusic() {
6161

6262
audioService.playMusic("testMusic", true);
6363

64-
verify(mockMusic).setVolume(0.5f);
64+
verify(mockMusic).setVolume(audioService.getMusicVolume());
6565
verify(mockMusic).setLooping(true);
6666
verify(mockMusic).play();
6767
}
@@ -84,7 +84,7 @@ void shouldPlaySound() {
8484

8585
audioService.playSound("testSound");
8686

87-
verify(mockSound).play(0.5f);
87+
verify(mockSound).play(audioService.getSoundVolume());
8888
}
8989

9090
@Test

0 commit comments

Comments
 (0)