use of com.b3dgs.lionengine.game.Force in project lionengine by b3dgs.
the class LaunchableConfigTest method testHashCode.
/**
* Test hash code.
*/
@Test
void testHashCode() {
final LaunchableConfig launchable = new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0));
assertHashEquals(launchable, launchable);
assertHashEquals(launchable, new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0)));
assertHashNotEquals(launchable, new LaunchableConfig("", "sfx", 10, 1, 2, new Force(1.0, 2.0)));
assertHashNotEquals(launchable, new LaunchableConfig("media", "", 10, 1, 2, new Force(1.0, 2.0)));
assertHashNotEquals(launchable, new LaunchableConfig("media", "sfx", 0, 1, 2, new Force(1.0, 2.0)));
assertHashNotEquals(launchable, new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(2.0, 1.0)));
assertHashNotEquals(launchable, new LaunchableConfig("media", "sfx", 10, 0, 2, new Force(1.0, 2.0)));
assertHashNotEquals(launchable, new LaunchableConfig("media", "sfx", 10, 1, 0, new Force(1.0, 2.0)));
}
use of com.b3dgs.lionengine.game.Force in project lionengine by b3dgs.
the class LaunchableConfigTest method testToString.
/**
* Test to string.
*/
@Test
void testToString() {
final LaunchableConfig launchable = new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0));
assertEquals("LaunchableConfig [media=media, sfx=sfx, delay=10, ox=1, oy=2, vector=" + "Force [fh=1.0, fv=2.0, velocity=0.0, sensibility=0.0]]", launchable.toString());
}
use of com.b3dgs.lionengine.game.Force in project lionengine by b3dgs.
the class LauncherConfigTest method testToString.
/**
* Test to string.
*/
@Test
void testToString() {
final LaunchableConfig launchable = new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0));
final LauncherConfig launcher = new LauncherConfig(0, 1, true, Arrays.asList(launchable, launchable));
assertEquals("LauncherConfig [level=0, delay=1, mirrorable=true, launchables=" + System.lineSeparator() + Constant.TAB + "LaunchableConfig [media=media, sfx=sfx, delay=10, ox=1, oy=2, vector=" + "Force [fh=1.0, fv=2.0, velocity=0.0, sensibility=0.0]]" + System.lineSeparator() + Constant.TAB + "LaunchableConfig [media=media, sfx=sfx, delay=10, ox=1, oy=2, vector=" + "Force [fh=1.0, fv=2.0, velocity=0.0, sensibility=0.0]]]", launcher.toString());
}
use of com.b3dgs.lionengine.game.Force in project lionengine by b3dgs.
the class LauncherConfigTest method testEquals.
/**
* Test equals.
*/
@Test
void testEquals() {
final LaunchableConfig launchable = new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0));
final LauncherConfig launcher = new LauncherConfig(0, 1, false, Arrays.asList(launchable));
assertEquals(launcher, launcher);
assertNotEquals(launcher, null);
assertNotEquals(launcher, new Object());
assertNotEquals(launcher, new LauncherConfig(0, 0, false, Arrays.asList(launchable)));
assertNotEquals(launcher, new LauncherConfig(0, 1, false, new ArrayList<LaunchableConfig>()));
assertNotEquals(launcher, new LauncherConfig(1, 0, false, Arrays.asList(launchable)));
assertNotEquals(launcher, new LauncherConfig(0, 0, true, Arrays.asList(launchable)));
assertNotEquals(launcher, new LauncherConfig(0, 1, true, new ArrayList<LaunchableConfig>()));
assertNotEquals(launcher, new LauncherConfig(1, 0, true, Arrays.asList(launchable)));
}
use of com.b3dgs.lionengine.game.Force in project lionengine by b3dgs.
the class LauncherConfigTest method testHashCode.
/**
* Test hash code.
*/
@Test
void testHashCode() {
final LaunchableConfig launchable = new LaunchableConfig("media", "sfx", 10, 1, 2, new Force(1.0, 2.0));
final LauncherConfig launcher = new LauncherConfig(0, 1, false, Arrays.asList(launchable));
assertHashEquals(launcher, launcher);
assertHashEquals(launcher, new LauncherConfig(0, 1, false, Arrays.asList(launchable)));
assertHashNotEquals(launcher, new LauncherConfig(0, 0, false, Arrays.asList(launchable)));
assertHashNotEquals(launcher, new LauncherConfig(0, 1, false, new ArrayList<LaunchableConfig>()));
assertHashNotEquals(launcher, new LauncherConfig(1, 0, false, Arrays.asList(launchable)));
assertHashNotEquals(launcher, new LauncherConfig(0, 1, true, Arrays.asList(launchable)));
assertHashNotEquals(launcher, new LauncherConfig(0, 0, true, Arrays.asList(launchable)));
assertHashNotEquals(launcher, new LauncherConfig(0, 1, true, new ArrayList<LaunchableConfig>()));
assertHashNotEquals(launcher, new LauncherConfig(1, 0, true, Arrays.asList(launchable)));
}
Aggregations