Skip to content

Commit

Permalink
Fix test using wrong ID
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Sep 2, 2024
1 parent f18f7e2 commit d963c4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/api.test/EventHandlers/TestMissionEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public async Task QueuedMissionsAreNotAbortedWhenRobotAvailableHappensAtTheSameT
var deck = await _databaseUtilities.NewDeck(installation.InstallationCode, plant.PlantCode);
var area = await _databaseUtilities.NewArea(installation.InstallationCode, plant.PlantCode, deck.Name);
var robot = await _databaseUtilities.NewRobot(RobotStatus.Available, installation, null);
var missionRun1 = await _databaseUtilities.NewMissionRun(installation.InstallationCode, robot, area, true, isarMissionId: Guid.NewGuid().ToString());
var missionRun1 = await _databaseUtilities.NewMissionRun(installation.InstallationCode, robot, area, true);
Thread.Sleep(100);
var missionRun2 = await _databaseUtilities.NewMissionRun(installation.InstallationCode, robot, area, true);
Thread.Sleep(100);
Expand All @@ -386,13 +386,16 @@ public async Task QueuedMissionsAreNotAbortedWhenRobotAvailableHappensAtTheSameT
_missionRunService.RaiseEvent(nameof(MissionRunService.MissionRunCreated), missionRunCreatedEventArgs);
Thread.Sleep(100);

var missionRun1PostCreation = await _missionRunService.ReadById(missionRun1.Id);
Assert.NotNull(missionRun1PostCreation);

// Act
var mqttIsarMissionEventArgs = new MqttReceivedArgs(
new IsarMissionMessage
{
RobotName = robot.Name,
IsarId = robot.IsarId,
MissionId = missionRun1.IsarMissionId,
MissionId = missionRun1PostCreation.IsarMissionId,
Status = "successful",
Timestamp = DateTime.UtcNow
});
Expand Down

0 comments on commit d963c4b

Please sign in to comment.