From 0b038fc4f94a4f3979d2947fb4c111b86e32df5b Mon Sep 17 00:00:00 2001 From: Vignesh Balasubramaniam Date: Thu, 27 Jun 2024 03:28:18 -0500 Subject: [PATCH] FIx unit test --- .../frc/robot/subsystems/ShooterSubsystemTest.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/test/java/frc/robot/subsystems/ShooterSubsystemTest.java b/src/test/java/frc/robot/subsystems/ShooterSubsystemTest.java index 024c6af..4f955a9 100644 --- a/src/test/java/frc/robot/subsystems/ShooterSubsystemTest.java +++ b/src/test/java/frc/robot/subsystems/ShooterSubsystemTest.java @@ -25,6 +25,7 @@ import org.mockito.ArgumentMatchers; import com.revrobotics.CANSparkBase.ControlType; +import com.revrobotics.SparkPIDController.ArbFFUnits; import edu.wpi.first.math.geometry.Pose2d; import edu.wpi.first.units.Angle; @@ -114,7 +115,9 @@ public void setState() { verify(m_topFlywheelMotor, times(1)).set(AdditionalMatchers.eq(state.speed.in(Units.MetersPerSecond), DELTA), ArgumentMatchers.eq(ControlType.kVelocity)); verify(m_angleMotor, times(1)).set( AdditionalMatchers.eq(state.angle.in(Units.Radians), DELTA), - ArgumentMatchers.eq(ControlType.kPosition) + ArgumentMatchers.eq(ControlType.kPosition), + ArgumentMatchers.anyDouble(), + ArgumentMatchers.eq(ArbFFUnits.kVoltage) ); } @@ -137,7 +140,9 @@ public void setHighAngle() { verify(m_topFlywheelMotor, times(1)).set(AdditionalMatchers.eq(state.speed.in(Units.MetersPerSecond), DELTA), ArgumentMatchers.eq(ControlType.kVelocity)); verify(m_angleMotor, times(1)).set( AdditionalMatchers.eq(Constants.Shooter.ANGLE_CONFIG.getUpperLimit(), DELTA), - ArgumentMatchers.eq(ControlType.kPosition) + ArgumentMatchers.eq(ControlType.kPosition), + ArgumentMatchers.anyDouble(), + ArgumentMatchers.eq(ArbFFUnits.kVoltage) ); } @@ -160,7 +165,9 @@ public void setLowAngle() { verify(m_topFlywheelMotor, times(1)).set(AdditionalMatchers.eq(state.speed.in(Units.MetersPerSecond), DELTA), ArgumentMatchers.eq(ControlType.kVelocity)); verify(m_angleMotor, times(1)).set( AdditionalMatchers.eq(Constants.Shooter.ANGLE_CONFIG.getLowerLimit(), DELTA), - ArgumentMatchers.eq(ControlType.kPosition) + ArgumentMatchers.eq(ControlType.kPosition), + ArgumentMatchers.anyDouble(), + ArgumentMatchers.eq(ArbFFUnits.kVoltage) ); }