Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ private MultiPhotonPoseEstimator(Builder builder) {
builder.cameraConfigs.entrySet().stream()
.map(entry -> createCameraWrapperFromConfig(builder, entry.getKey(), entry.getValue()))
.collect(Collectors.toCollection(ArrayList::new));
poseEstimatorStrategy = builder.poseEstimatorStrategy;
}

/**
Expand Down
14 changes: 13 additions & 1 deletion src/test/java/com/team2813/RobotContainerTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.team2813;

import com.team2813.lib2813.testing.junit.jupiter.CommandTester;
import com.team2813.lib2813.testing.junit.jupiter.WPILibExtension;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj2.command.Commands;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(IsolatedNetworkTablesExtension.class)
@ExtendWith({IsolatedNetworkTablesExtension.class, WPILibExtension.class})
public final class RobotContainerTest {
private final FakeShuffleboardTabs shuffleboard = new FakeShuffleboardTabs();

Expand All @@ -19,4 +22,13 @@ public void conBeConstructedMultipleTimes(NetworkTableInstance ntInstance) {
//noinspection EmptyTryBlock
try (var container = new RobotContainer(shuffleboard, ntInstance)) {}
}

@Test
public void periodicDoesNotFail(CommandTester commandTester, NetworkTableInstance ntInstance) {
try (RobotContainer container = new RobotContainer(shuffleboard, ntInstance)) {
// Runs the periodic method at least once. If the periodic method would fail with an
// exception, this will fail with an exception and fail the test.
commandTester.runUntilComplete(Commands.none());
}
}
}