| | |
| | | } |
| | | |
| | | @Test |
| | | void testSnapshotKeepsCurrentStepVisibleWhenPlaybackEntersNextCycle() throws Exception |
| | | { |
| | | InMemoryBtsSimulatorStateStore store = new InMemoryBtsSimulatorStateStore(); |
| | | try (BtsDevelopmentSimulator simulator = new BtsDevelopmentSimulator(0, store)) |
| | | { |
| | | simulator.updateChannel(1, 1, true, DeviceWorkStatus.WORKING); |
| | | simulator.nextBtsCycle(1, 1); |
| | | var snapshot = simulator.btsTest(1, 1); |
| | | var expectedSteps = BtsExcelFixture.recordsForCycle(2).stream() |
| | | .map(BtsExcelFixture.FixtureRecord::stepNo).distinct().toList(); |
| | | var actualSteps = snapshot.rows().stream().filter(row -> "STEP".equals(row.rowType())) |
| | | .map(BtsDevelopmentSimulator.BtsTestPlanRow::stepNo).toList(); |
| | | assertEquals(expectedSteps, actualSteps); |
| | | assertTrue(snapshot.rows().stream().anyMatch(row -> "STEP".equals(row.rowType()) && "进行中".equals(row.executionStatus()))); |
| | | assertTrue(snapshot.rows().stream().anyMatch(row -> "STEP".equals(row.rowType()) && "待执行".equals(row.executionStatus()))); |
| | | var cycleRow = snapshot.rows().stream().filter(row -> "CYCLE".equals(row.rowType())).findFirst().orElseThrow(); |
| | | assertEquals(2, cycleRow.stepNo()); |
| | | assertEquals(2, cycleRow.cycleCount()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | void playbackSpeedPauseResumeAndRestartAreIndependentOfDeviceStatus() throws Exception |
| | | { |
| | | Instant start = Instant.parse("2026-08-31T00:00:00Z"); |