Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
neoancient committed Feb 21, 2024
1 parent 480f35a commit 88f999f
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import java.util.Arrays;
import java.util.Collections;

import org.mockito.Mockito.*;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -58,7 +56,7 @@ private Entity configureFromFilename(String fname) throws EntityLoadingException
@Test
void testGetValueAtForAll() throws EntityLoadingException {
// Test getValue() in EquipmentTableModel; the exercises conversions and lookups
ArrayList<String> testItems = new ArrayList<String>(Arrays.asList(
ArrayList<String> testItems = new ArrayList<>(Arrays.asList(
"/Kirghiz C.blk", // ASF
"/Beast Infantry (Elephant)(Laser Rifle_Support PPC).blk", // Beast Inf
"/Black Wolf BA (ER Pulse) (Sqd5).blk", // BA, Clan
Expand Down Expand Up @@ -92,7 +90,7 @@ void testGetDamageStringForAero() throws EntityLoadingException {
// Test reading damage strings for ASF weapons
String fname = "/Kirghiz C.blk";
Entity te = configureFromFilename(fname);
assertEquals(true, te.isAero());
assertTrue(te.isAero());
for (Mounted weapon: te.getWeaponList()) {
WeaponType weaponType = (WeaponType) weapon.getType();
String dString = EquipmentTableModel.getDamageString(weaponType, te.isAero());
Expand All @@ -112,7 +110,7 @@ void testGetDamageStringForCI() throws EntityLoadingException {
// Test reading damage strings for CI weapons
String fname = "/Jump Squad (LRM).blk";
Entity te = configureFromFilename(fname);
assertEquals(false, te.isAero());
assertFalse(te.isAero());
for (Mounted weapon: te.getWeaponList()) {
WeaponType weaponType = (WeaponType) weapon.getType();
String dString = EquipmentTableModel.getDamageString(weaponType, te.isAero());
Expand All @@ -128,13 +126,12 @@ void testGetDamageStringForGEArty() throws EntityLoadingException {
// Test reading damage strings for CI weapons
String fname = "/Long Tom Cannon Turret (Quad).blk";
Entity te = configureFromFilename(fname);
assertEquals(false, te.isAero());
assertFalse(te.isAero());
for (Mounted weapon: te.getWeaponList()) {
WeaponType weaponType = (WeaponType) weapon.getType();
String dString = EquipmentTableModel.getDamageString(weaponType, te.isAero());
// Confirm can convert to double
assertEquals(Integer.toString(weaponType.getRackSize())+"A",
dString);
assertEquals(weaponType.getRackSize() + "A", dString);
}
}
}

0 comments on commit 88f999f

Please sign in to comment.