From 72346ee6e6f5e35478dd0f5c99c6bf4814c46774 Mon Sep 17 00:00:00 2001 From: dtookey Date: Mon, 7 Aug 2023 08:41:38 -0400 Subject: [PATCH] real crappy tests implemented for all of the controllers --- .../kotlin/controllers/RobotAutomatonTest.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/kotlin/controllers/RobotAutomatonTest.kt diff --git a/src/test/kotlin/controllers/RobotAutomatonTest.kt b/src/test/kotlin/controllers/RobotAutomatonTest.kt new file mode 100644 index 0000000..56a636a --- /dev/null +++ b/src/test/kotlin/controllers/RobotAutomatonTest.kt @@ -0,0 +1,25 @@ +package controllers + +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test +import java.awt.Point + +internal class RobotAutomatonTest { + + private val robot = RobotAutomaton() + + /** + * Tests that [RobotAutomaton.moveMouse] moves the mouse pointer to the + * provided [Point] coordinates. + */ + @Test + fun `moveMouse moves to given coordinates`() { + val point = Point(100, 200) + + robot.moveMouse(point) + + val current = robot.getPointerLocation() + assertEquals(point, current) + } + +}