Skip to content

Commit

Permalink
remove a couple getters
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 committed Nov 10, 2024
1 parent 8e368a1 commit 7d9955f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/test/java/SwerveDriveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ void setUp() {
swerveDrive.setKinematics(swerveDriveKinematics);
}

@Test
void testGetGyroRate() {
// Mock gyro inputs
when(swerveDrive.getGyroRate()).thenReturn(0.5);

// Test the getGyroRate method
double gyroRate = swerveDrive.getGyroRate();
assertEquals(0.5, gyroRate, 0.001);
}

@Test
void testDrive() {
// Prepare mock module states
Expand All @@ -81,19 +71,6 @@ void testDrive() {
verify(swerveDrive.getKinematics()).toSwerveModuleStates(any(ChassisSpeeds.class));
}

@Test
void testGetPose() {
// Mock the pose estimator to return a specific pose
Pose2d mockPose = new Pose2d(1.0, 2.0, new Rotation2d(Math.toRadians(45)));
when(swerveDrive.getPose()).thenReturn(mockPose);

// Call the getPose method and verify the returned pose
Pose2d pose = swerveDrive.getPose();
assertEquals(1.0, pose.getX(), 0.001);
assertEquals(2.0, pose.getY(), 0.001);
assertEquals(Math.toRadians(45), pose.getRotation().getRadians(), 0.001);
}

@Test
void testSetPose() {
// Mock pose setter
Expand Down

0 comments on commit 7d9955f

Please sign in to comment.