From 6a1ad7607dcf9fabf2e1b173606ecdfc1e960722 Mon Sep 17 00:00:00 2001 From: Meron Date: Fri, 21 Jun 2024 11:45:04 +0200 Subject: [PATCH] [cleanup] Minor improvement to a Unittest --- .../entities/motion/MotionApplierTest.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/github/hanyaeger/core/entities/motion/MotionApplierTest.java b/src/test/java/com/github/hanyaeger/core/entities/motion/MotionApplierTest.java index b29087f0c..1e1a1b174 100644 --- a/src/test/java/com/github/hanyaeger/core/entities/motion/MotionApplierTest.java +++ b/src/test/java/com/github/hanyaeger/core/entities/motion/MotionApplierTest.java @@ -237,14 +237,14 @@ void setDirectionRIGHTForSpeedOneCreatesRightVectorTest() { @Test void setDirectionToUPForSpeedOneCreatesUpVectorTest() { // Arrange - sut.setSpeed(1); + sut.setSpeed(2); // Act sut.setDirection(Direction.UP); // Assert assertEquals(0, sut.get().getX(), DELTA); - assertEquals(-1, sut.get().getY(), DELTA); + assertEquals(-2, sut.get().getY(), DELTA); } @Test @@ -329,14 +329,14 @@ void resetSpeedAfterSpeedHasBeenSetToZeroCreatesCorrectVectorTest() { @Test void getDirectionForDirectionBelow180TestReturnsCorrectValue() { // Arrange - final double DIRECTION = 42; - sut.setMotion(1, DIRECTION); + final double expected = 42; + sut.setMotion(1, expected); // Act - var direction = sut.getDirection(); + var actual = sut.getDirection(); // Assert - assertEquals(DIRECTION, direction, DELTA); + assertEquals(expected, actual, DELTA); } @Test @@ -366,14 +366,14 @@ void getDirectionsReturnsNumericValueWhenEnumIsForDirectionWasUsedInMotionTest() @Test void getDirectionForDirectionAbove180ReturnsCorrectValueTest() { // Arrange - final double DIRECTION = 189; - sut.setMotion(1, DIRECTION); + final double expected = 189; + sut.setMotion(1, expected); // Act - var direction = sut.getDirection(); + var actual = sut.getDirection(); // Assert - assertEquals(DIRECTION, direction, DELTA); + assertEquals(expected, actual, DELTA); } @Test @@ -392,7 +392,7 @@ void getDirectionAfterSpeedSetTo0ReturnsCorrectDirection(){ @Test void changeDirectionWithZeroDoesNotChangeAngleTest() { // Arrange - sut.setMotion(1, Direction.DOWN.getValue()); + sut.setMotion(2, Direction.DOWN.getValue()); // Act sut.changeDirection(0);