mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-09-12 22:45:18 -04:00
Merge pull request #594 from madsboddum/cu_quality_assurance
Wrote a couple of automated tests for "Your modified Speed" to ensure…
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
package com.projectswg.holocore.resources.support.objects.swg.weapon;
|
||||
|
||||
import com.projectswg.holocore.resources.support.objects.ObjectCreator;
|
||||
import com.projectswg.holocore.test.resources.GenericCreatureObject;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class WeaponObjectTest {
|
||||
|
||||
@Test
|
||||
public void yourModifiedAttackSpeedTakesPresentSpeedModsIntoAccount() {
|
||||
WeaponObject weaponObject = (WeaponObject) ObjectCreator.createObjectFromTemplate("object/weapon/melee/unarmed/shared_unarmed_default_player.iff");
|
||||
weaponObject.setType(WeaponType.UNARMED);
|
||||
weaponObject.setAttackSpeed(2.5f);
|
||||
GenericCreatureObject genericCreatureObject = new GenericCreatureObject(1);
|
||||
genericCreatureObject.adjustSkillmod("melee_speed", 0, 25);
|
||||
genericCreatureObject.adjustSkillmod("unarmed_speed", 0, 25);
|
||||
|
||||
assertEquals(1.25, weaponObject.getModdedWeaponAttackSpeedWithCap(genericCreatureObject), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void yourModifiedAttackSpeedTakesMissingSpeedModsIntoAccount() {
|
||||
WeaponObject weaponObject = (WeaponObject) ObjectCreator.createObjectFromTemplate("object/weapon/melee/unarmed/shared_unarmed_default_player.iff");
|
||||
weaponObject.setType(WeaponType.UNARMED);
|
||||
weaponObject.setAttackSpeed(2.5f);
|
||||
GenericCreatureObject genericCreatureObject = new GenericCreatureObject(1);
|
||||
|
||||
assertEquals(2.5f, weaponObject.getModdedWeaponAttackSpeedWithCap(genericCreatureObject), 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user