Skip to content

Commit

Permalink
add a test for sparkWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
MEFThunders7035 committed Feb 26, 2024
1 parent dadbd32 commit 7f55b26
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/java/SparkMAXWrapperTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import edu.wpi.first.hal.HAL;
import frc.utils.sim_utils.CANSparkMAXWrapped;
import frc.utils.sim_utils.SparkMAXSimAddon;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class SparkMAXWrapperTest {
@BeforeEach
public void setUp() {
HAL.initialize(500, 0); // init HAL just in case
}

@Test
void testSparkMAXWrapper() {
for (int i = 0; i < 50; i++) {
CANSparkMAXWrapped sparkMAX =
new CANSparkMAXWrapped(i, CANSparkMAXWrapped.MotorType.kBrushless);
assertEquals(sparkMAX, SparkMAXSimAddon.getSparkMAX(i));
sparkMAX.close();
}
}
}

0 comments on commit 7f55b26

Please sign in to comment.