diff --git a/megamek/unittests/megamek/server/GameManagerTest.java b/megamek/unittests/megamek/server/GameManagerTest.java index 9c2b3cd506e..6879dbc1a52 100644 --- a/megamek/unittests/megamek/server/GameManagerTest.java +++ b/megamek/unittests/megamek/server/GameManagerTest.java @@ -28,7 +28,7 @@ void setUp() { } @Test - void testAddControlWithAdvAtmosphericMergesIntoOneRoll() { + void testAddControlWithAdvAtmosphericMergesIntoOneRollAero() { AeroSpaceFighter aero = new AeroSpaceFighter(); game.addEntity(aero); Vector rolls = new Vector<>(); @@ -47,7 +47,7 @@ void testAddControlWithAdvAtmosphericMergesIntoOneRoll() { } @Test - void testAddControlWithAdvAtmosphericIncludesAllReasons() { + void testAddControlWithAdvAtmosphericIncludesAllReasonsAero() { AeroSpaceFighter aero = new AeroSpaceFighter(); game.addEntity(aero); Vector rolls = new Vector<>(); @@ -63,4 +63,37 @@ void testAddControlWithAdvAtmosphericIncludesAllReasons() { assertTrue(reasons.toString().contains("threshold")); assertTrue(reasons.toString().contains("highest damage threshold exceeded")); } + + @Test + void testAddControlWithAdvAtmosphericMergesIntoOneRollLAM() { + LandAirMech mech = new LandAirMech(LandAirMech.GYRO_STANDARD, LandAirMech.COCKPIT_STANDARD, LandAirMech.LAM_STANDARD); + game.addEntity(mech); + Vector rolls = new Vector<>(); + StringBuilder reasons = new StringBuilder(); + + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "avionics hit")); + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "threshold")); + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "highest damage threshold exceeded")); + gameManager.addControlWithAdvAtmospheric(mech, rolls, reasons); + assertEquals(1, rolls.size()); + assertTrue(reasons.toString().contains("avionics hit")); + assertTrue(reasons.toString().contains("threshold")); + assertTrue(reasons.toString().contains("highest damage threshold exceeded")); + } + + @Test + void testAddControlWithAdvAtmosphericIncludesAllReasonsLAM() { + LandAirMech mech = new LandAirMech(LandAirMech.GYRO_STANDARD, LandAirMech.COCKPIT_STANDARD, LandAirMech.LAM_STANDARD); + game.addEntity(mech); + Vector rolls = new Vector<>(); + StringBuilder reasons = new StringBuilder(); + + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "avionics hit")); + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "threshold")); + game.addControlRoll(new PilotingRollData(mech.getId(), 0, "highest damage threshold exceeded")); + gameManager.addControlWithAdvAtmospheric(mech, rolls, reasons); + assertTrue(reasons.toString().contains("avionics hit")); + assertTrue(reasons.toString().contains("threshold")); + assertTrue(reasons.toString().contains("highest damage threshold exceeded")); + } } \ No newline at end of file