Set up Mockito and simple Unit Test

This commit is contained in:
Keenan D. Buckley
2020-03-28 22:45:44 -06:00
parent e373211f27
commit 489d4a5bff
5 changed files with 62 additions and 4 deletions
@@ -37,13 +37,13 @@ public class Drive extends SubsystemBase {
* Add your docs here.
*/
public Drive(WPI_TalonSRX leftFrontMotor, WPI_TalonSRX rightFrontMotor, WPI_TalonSRX leftBackMotor,
WPI_TalonSRX rightBackMotor, RobotGyro gyro) {
WPI_TalonSRX rightBackMotor, DifferentialDrive driveTrain, RobotGyro gyro) {
m_leftFrontMotor = leftFrontMotor;
m_rightFrontMotor = rightFrontMotor;
m_leftBackMotor = leftBackMotor;
m_rightBackMotor = rightBackMotor;
m_driveTrain = new DifferentialDrive(m_leftFrontMotor, m_rightFrontMotor);
m_driveTrain = driveTrain;
m_gyro = gyro;
}
@@ -63,6 +63,14 @@ public class Drive extends SubsystemBase {
m_driveTrain.arcadeDrive(move, steer);
}
/**
* Add your docs here.
*/
public void tankDriveWithInput(double leftMove, double rightMove) {
m_leftFrontMotor.set(leftMove);
m_rightFrontMotor.set(rightMove);
}
/**
* Add your docs here.
*/