-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dadbd32
commit 7f55b26
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |