if (isImmobilized(entity) && !(entity instanceof Infantry)) { msg.append("is immobile."); movingEntity = entity;
@Test public void testIsImmobilized() { Mockito.when(mockPrincess.isImmobilized(Mockito.any(Entity.class))).thenCallRealMethod(); Mockito.when(mockPrincess.getBooleanOption(Mockito.eq("tacops_careful_stand"))).thenReturn(false); Mockito.anyBoolean())) .thenReturn(mockPilotingRollData); Assert.assertFalse(mockPrincess.isImmobilized(mockMech)); Assert.assertFalse(mockPrincess.isImmobilized(mockMech)); Assert.assertTrue(mockPrincess.isImmobilized(mockMech)); Assert.assertTrue(mockPrincess.isImmobilized(mockMech)); Mockito.when(mockMech.getRunMP()).thenReturn(6); Mockito.when(mockTank.isImmobile()).thenReturn(false); Mockito.when(mockTank.isShutDown()).thenReturn(false); Assert.assertFalse(mockPrincess.isImmobilized(mockTank)); Mockito.when(mockMech.isProne()).thenReturn(true); Mockito.when(mockMech.cannotStandUpFromHullDown()).thenReturn(true); Assert.assertTrue(mockPrincess.isImmobilized(mockMech)); Mockito.when(mockMech.isProne()).thenReturn(true); Mockito.when(mockMech.cannotStandUpFromHullDown()).thenReturn(false); Assert.assertFalse(mockPrincess.isImmobilized(mockMech)); Mockito.when(mockMech.isProne()).thenReturn(true); Mockito.when(mockMech.cannotStandUpFromHullDown()).thenReturn(false);
@Test public void testGetEntityToMove() { Mockito.when(mockPrincess.getEntityToMove()).thenCallRealMethod(); Mockito.when(mockPrincess.isImmobilized(Mockito.any(Entity.class))).thenCallRealMethod();
if (isImmobilized(entity) && entity.isEjectionPossible()) { msg = entity.getDisplayName() + " is immobile. Abandoning unit.";