Unlucky
Unlucky copied to clipboard
Both the origin and position of an instance of the Moving class is changing instead of the position only, and origin no Bug.
Arrange:
- Configuring the environment (with for example Gradle v3.3).
- Importing the junit .jar files, so we can run junit test cases.
- The com.badlogic.gdx.math.Vector2 Class is available and we can make Vector2 objects from it.
Act:
- Making an instance of Moving Class with the following parameters:
- origin = new Vector2(1, 2)
- target = new Vector2(7, 5)
- speed = 1.4f
- Store this instance in a variable and call it as "moving1".
- Call the start() method on the "moving1" variable.
- Call the update() method on the "moving1" variable with number two as parameter.
Assert:
- The position of the object is changing, but the origin will not.
Excepting:
- The position of the object is changed, while the origin stay still after the call of the update() method.
Actually:
- Both the origin and position of the "moving1" changed after the call of the method.