@@ -53,7 +53,16 @@ public async Task CheckThatSchedulingAMissionToBusyRobotSetsMissionToPending()
5353 {
5454 // Arrange
5555 var installation = await DatabaseUtilities . NewInstallation ( ) ;
56- var robot = await DatabaseUtilities . NewRobot ( RobotStatus . Busy , installation ) ;
56+ var plant = await DatabaseUtilities . NewPlant ( installation . InstallationCode ) ;
57+ var inspectionArea = await DatabaseUtilities . NewInspectionArea (
58+ installation . InstallationCode ,
59+ plant . PlantCode
60+ ) ;
61+ var robot = await DatabaseUtilities . NewRobot (
62+ RobotStatus . Busy ,
63+ installation ,
64+ inspectionArea
65+ ) ;
5766 string missionsUrl = "/missions" ;
5867
5968 // Act
@@ -86,7 +95,16 @@ public async Task CheckThatSchedulingThreeAdditionalMissionsToTheQueueWorksAsExp
8695 {
8796 // Arrange
8897 var installation = await DatabaseUtilities . NewInstallation ( ) ;
89- var robot = await DatabaseUtilities . NewRobot ( RobotStatus . Busy , installation ) ;
98+ var plant = await DatabaseUtilities . NewPlant ( installation . InstallationCode ) ;
99+ var inspectionArea = await DatabaseUtilities . NewInspectionArea (
100+ installation . InstallationCode ,
101+ plant . PlantCode
102+ ) ;
103+ var robot = await DatabaseUtilities . NewRobot (
104+ RobotStatus . Busy ,
105+ installation ,
106+ inspectionArea
107+ ) ;
90108
91109 // Act
92110 var query = new ScheduledMissionQuery
@@ -161,13 +179,13 @@ public async Task ScheduleDuplicateCustomMissionDefinitions()
161179 installation . InstallationCode ,
162180 plant . PlantCode
163181 ) ;
164- var robot = await DatabaseUtilities . NewRobot ( RobotStatus . Busy , installation ) ;
165-
166- var query = CreateDefaultCustomMissionQuery (
167- robot . Id ,
168- installation . InstallationCode ,
169- inspectionArea . Name
182+ var robot = await DatabaseUtilities . NewRobot (
183+ RobotStatus . Busy ,
184+ installation ,
185+ inspectionArea
170186 ) ;
187+
188+ var query = CreateDefaultCustomMissionQuery ( robot . Id , installation . InstallationCode ) ;
171189 var content = new StringContent (
172190 JsonSerializer . Serialize ( query ) ,
173191 null ,
@@ -205,13 +223,13 @@ public async Task CheckThatNextRunIsCorrectlySelectedWhenSchedulingMultipleMissi
205223 installation . InstallationCode ,
206224 plant . PlantCode
207225 ) ;
208- var robot = await DatabaseUtilities . NewRobot ( RobotStatus . Available , installation ) ;
209-
210- var query = CreateDefaultCustomMissionQuery (
211- robot . Id ,
212- installation . InstallationCode ,
213- inspectionArea . Name
226+ var robot = await DatabaseUtilities . NewRobot (
227+ RobotStatus . Available ,
228+ installation ,
229+ inspectionArea
214230 ) ;
231+
232+ var query = CreateDefaultCustomMissionQuery ( robot . Id , installation . InstallationCode ) ;
215233 var content = new StringContent (
216234 JsonSerializer . Serialize ( query ) ,
217235 null ,
@@ -300,13 +318,13 @@ public async Task CheckThatMissionDoesNotStartIfRobotIsNotInSameInstallationAsMi
300318 ) ;
301319
302320 var otherInstallation = await DatabaseUtilities . NewInstallation ( "OtherCode" ) ;
303- var robot = await DatabaseUtilities . NewRobot ( RobotStatus . Available , otherInstallation ) ;
304-
305- var query = CreateDefaultCustomMissionQuery (
306- robot . Id ,
307- installation . InstallationCode ,
308- inspectionArea . Name
321+ var robot = await DatabaseUtilities . NewRobot (
322+ RobotStatus . Available ,
323+ otherInstallation ,
324+ inspectionArea
309325 ) ;
326+
327+ var query = CreateDefaultCustomMissionQuery ( robot . Id , installation . InstallationCode ) ;
310328 var content = new StringContent (
311329 JsonSerializer . Serialize ( query ) ,
312330 null ,
@@ -326,55 +344,52 @@ public async Task CheckThatMissionFailsIfRobotIsNotInSameInspectionAreaAsMission
326344 var installation = await DatabaseUtilities . NewInstallation ( ) ;
327345 var plant = await DatabaseUtilities . NewPlant ( installation . InstallationCode ) ;
328346
329- var inspectionPolygonOne = new InspectionAreaPolygon
347+ var inspectionPolygonRobot = new InspectionAreaPolygon
330348 {
331349 ZMin = 0 ,
332350 ZMax = 10 ,
333351 Positions =
334352 [
335- new XYPosition { X = 0 , Y = 0 } ,
336- new XYPosition { X = 0 , Y = 10 } ,
337- new XYPosition { X = 10 , Y = 10 } ,
338- new XYPosition { X = 10 , Y = 0 } ,
353+ new XYPosition { X = 11 , Y = 11 } ,
354+ new XYPosition { X = 11 , Y = 20 } ,
355+ new XYPosition { X = 20 , Y = 20 } ,
356+ new XYPosition { X = 20 , Y = 11 } ,
339357 ] ,
340358 } ;
341- var inspectionAreaOne = await DatabaseUtilities . NewInspectionArea (
359+
360+ var inspectionAreaRobot = await DatabaseUtilities . NewInspectionArea (
342361 installation . InstallationCode ,
343362 plant . PlantCode ,
344- "InspectionAreaOne " ,
345- inspectionPolygonOne
363+ "InspectionAreaRobot " ,
364+ inspectionPolygonRobot
346365 ) ;
347366
348- var inspectionPolygonTwo = new InspectionAreaPolygon
367+ var inspectionPolygonMission = new InspectionAreaPolygon
349368 {
350369 ZMin = 0 ,
351370 ZMax = 10 ,
352371 Positions =
353372 [
354- new XYPosition { X = 11 , Y = 11 } ,
355- new XYPosition { X = 11 , Y = 20 } ,
356- new XYPosition { X = 20 , Y = 20 } ,
357- new XYPosition { X = 20 , Y = 11 } ,
373+ new XYPosition { X = 0 , Y = 0 } ,
374+ new XYPosition { X = 0 , Y = 10 } ,
375+ new XYPosition { X = 10 , Y = 10 } ,
376+ new XYPosition { X = 10 , Y = 0 } ,
358377 ] ,
359378 } ;
360- var inspectionAreaTwo = await DatabaseUtilities . NewInspectionArea (
379+ var _inspectionAreaMission = await DatabaseUtilities . NewInspectionArea (
361380 installation . InstallationCode ,
362381 plant . PlantCode ,
363- "InspectionAreaTwo " ,
364- inspectionPolygonTwo
382+ "InspectionAreaMission " ,
383+ inspectionPolygonMission
365384 ) ;
366385
367386 var robot = await DatabaseUtilities . NewRobot (
368387 RobotStatus . Available ,
369388 installation ,
370- inspectionAreaOne
389+ inspectionAreaRobot
371390 ) ;
372391
373- var query = CreateDefaultCustomMissionQuery (
374- robot . Id ,
375- installation . InstallationCode ,
376- inspectionAreaTwo . Name
377- ) ;
392+ var query = CreateDefaultCustomMissionQuery ( robot . Id , installation . InstallationCode ) ;
378393 var content = new StringContent (
379394 JsonSerializer . Serialize ( query ) ,
380395 null ,
@@ -389,15 +404,13 @@ public async Task CheckThatMissionFailsIfRobotIsNotInSameInspectionAreaAsMission
389404
390405 private static CustomMissionQuery CreateDefaultCustomMissionQuery (
391406 string robotId ,
392- string installationCode ,
393- string inspectionAreaName
407+ string installationCode
394408 )
395409 {
396410 return new CustomMissionQuery
397411 {
398412 RobotId = robotId ,
399413 InstallationCode = installationCode ,
400- InspectionAreaName = inspectionAreaName ,
401414 DesiredStartTime = DateTime . SpecifyKind ( new DateTime ( 3050 , 1 , 1 ) , DateTimeKind . Utc ) ,
402415 InspectionFrequency = new TimeSpan ( 14 , 0 , 0 , 0 ) ,
403416 Name = "TestMission" ,
0 commit comments