-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathout2.txt
650 lines (508 loc) · 11.3 KB
/
out2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# FORMAT per a fer el test: #
# nomMetode, valorArgument1, valorArgument2, valorArgumentN #
# Admet String's, tipus de dades primitius i dates (java.util.Date) #
# en format dd-MM-yyyy HH:mm:ss #
# No suporta metodes homonims amb el mateix nombre de parametres #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# EP2 test
# ERROR
users()
ERROR: There are no users
addUser(000000A, Joan, Lopez)
void
addUser(111111A, Philip, McCarthy)
void
addUser(222222B, Jooooooohn, Petit)
void
addUser(333333C, Peter, Esteban)
void
addUser(444444D, Xavi, Casajoana)
void
addUser(555555E, Pol, Izquierdo)
void
addUser(666666X, Jordi, Salvat)
void
users()
id: 000000A name: Joan surname: Lopez
id: 111111A name: Philip surname: McCarthy
id: 222222B name: Jooooooohn surname: Petit
id: 333333C name: Peter surname: Esteban
id: 444444D name: Xavi surname: Casajoana
id: 555555E name: Pol surname: Izquierdo
id: 666666X name: Jordi surname: Salvat
# ERROR
movies()
ERROR: There are no movies
addMovie(M6, Star Wars: Episode VII – The Force Awakens, 135, J. J. Abrams)
void
addMovie(M2, Star Wars: Episode V - The Empire Strikes Back, 124, Irvin Kershner)
void
addMovie(M4, Superman, 143, Richard Donner)
void
addMovie(M7, Star Wars VIII – The Last Jedi, 152, Rian Johnson)
void
addMovie(M5, Gone with the Wind, 221, Victor Fleming)
void
addMovie(M3, Star Wars: Episode VI - Return of the Jedi, 124, Richard Marquand)
void
addMovie(M1, Star Wars: Episode IV - A New Hope, 121, George Lucas)
void
movies()
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 0
rating: 0
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 0
rating: 0
idMovie:M3
title: Star Wars: Episode VI - Return of the Jedi
director: Richard Marquand
duration: 124
views: 0
rating: 0
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 0
rating: 0
idMovie:M5
title: Gone with the Wind
director: Victor Fleming
duration: 221
views: 0
rating: 0
idMovie:M6
title: Star Wars: Episode VII – The Force Awakens
director: J. J. Abrams
duration: 135
views: 0
rating: 0
idMovie:M7
title: Star Wars VIII – The Last Jedi
director: Rian Johnson
duration: 152
views: 0
rating: 0
watchMovie(000000A, M5)
void
# ERROR
getUser(XXXXXX)
ERROR: User not found
getUser(000000A)
id: 000000A name: Joan surname: Lopez
watching movie:
idMovie:M5
title: Gone with the Wind
director: Victor Fleming
duration: 221
views: 0
rating: 0
watchMovie(000000A, M1)
void
getUser(000000A)
id: 000000A name: Joan surname: Lopez
watching movie:
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 0
rating: 0
watchMovie(111111A, M2)
void
getUser(111111A)
id: 111111A name: Philip surname: McCarthy
watching movie:
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 0
rating: 0
watchMovie(222222B, M2)
void
watchMovie(555555E, M5)
void
watchMovie(555555E, M2)
void
getUser(555555E)
id: 555555E name: Pol surname: Izquierdo
watching movie:
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 0
rating: 0
watchMovie(666666X, M4)
void
endMovie(000000A, 26-10-2017 20:00:00)
void
endMovie(111111A, 26-10-2017 20:00:00)
void
endMovie(222222B, 26-10-2017 20:00:00)
void
endMovie(555555E, 26-10-2017 20:00:00)
void
endMovie(666666X, 27-10-2017 10:00:00)
void
watchMovie(111111A, M4)
void
endMovie(111111A, 01-10-2017 10:00:00)
void
topMovies()
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 0
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 2
rating: 0
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 1
rating: 0
# ERROR
pauseMovie(333333C, 50)
ERROR: User isn't watching any movie
watchMovie(333333C, M2)
void
pauseMovie(333333C, 50)
void
watchMovie(333333C, M7)
void
pauseMovie(333333C, 25)
void
watchMovie(333333C, M4)
void
pauseMovie(333333C, 45)
void
watchMovie(333333C, M1)
void
pauseMovie(333333C, 29)
void
getUser(333333C)
id: 333333C name: Peter surname: Esteban
paused movies:
movie: M2 - Star Wars: Episode V - The Empire Strikes Back, minute: 50
movie: M7 - Star Wars VIII – The Last Jedi, minute: 25
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
# ERROR
pauseMovie(333333C, 60)
ERROR: User isn't watching any movie
# ERROR
resumeMovie(XXXXXX, M2)
ERROR: User not found
# ERROR
resumeMovie(333333C, XXX)
ERROR: No paused movie
resumeMovie(333333C, M2)
void
getUser(333333C)
id: 333333C name: Peter surname: Esteban
watching movie:
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 0
paused movies:
movie: M7 - Star Wars VIII – The Last Jedi, minute: 25
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
# ERROR
pauseMovie(333333C, 200)
ERROR: Duration exceeded
pauseMovie(333333C, 60)
void
getUser(333333C)
id: 333333C name: Peter surname: Esteban
paused movies:
movie: M7 - Star Wars VIII – The Last Jedi, minute: 25
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
movie: M2 - Star Wars: Episode V - The Empire Strikes Back, minute: 60
# ERROR
endMovie(333333C, 31-10-2017 10:00:00)
ERROR: User isn't watching any movie
resumeMovie(333333C, M7)
void
getUser(333333C)
id: 333333C name: Peter surname: Esteban
watching movie:
idMovie:M7
title: Star Wars VIII – The Last Jedi
director: Rian Johnson
duration: 152
views: 0
rating: 0
paused movies:
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
movie: M2 - Star Wars: Episode V - The Empire Strikes Back, minute: 60
endMovie(333333C, 31-10-2017 10:00:00)
void
getUser(333333C)
id: 333333C name: Peter surname: Esteban
paused movies:
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
movie: M2 - Star Wars: Episode V - The Empire Strikes Back, minute: 60
watched movies:
M7 Star Wars VIII – The Last Jedi 31-10-2017 10:00:00
topMovies()
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 0
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 2
rating: 0
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 1
rating: 0
idMovie:M7
title: Star Wars VIII – The Last Jedi
director: Rian Johnson
duration: 152
views: 1
rating: 0
watchMovie(111111A, M5)
void
endMovie(111111A, 07-10-2017 10:00:00)
void
# Expected M4, M5, M2
getUserWatchedMovies(111111A)
M4 Superman 01-10-2017 10:00:00
M5 Gone with the Wind 07-10-2017 10:00:00
M2 Star Wars: Episode V - The Empire Strikes Back 26-10-2017 20:00:00
getUser(111111A)
id: 111111A name: Philip surname: McCarthy
watched movies:
M4 Superman 01-10-2017 10:00:00
M5 Gone with the Wind 07-10-2017 10:00:00
M2 Star Wars: Episode V - The Empire Strikes Back 26-10-2017 20:00:00
getUser(222222B)
id: 222222B name: Jooooooohn surname: Petit
watched movies:
M2 Star Wars: Episode V - The Empire Strikes Back 26-10-2017 20:00:00
getUser(333333C)
id: 333333C name: Peter surname: Esteban
paused movies:
movie: M4 - Superman, minute: 45
movie: M1 - Star Wars: Episode IV - A New Hope, minute: 29
movie: M2 - Star Wars: Episode V - The Empire Strikes Back, minute: 60
watched movies:
M7 Star Wars VIII – The Last Jedi 31-10-2017 10:00:00
getUser(555555E)
id: 555555E name: Pol surname: Izquierdo
watched movies:
M2 Star Wars: Episode V - The Empire Strikes Back 26-10-2017 20:00:00
getUser(666666X)
id: 666666X name: Jordi surname: Salvat
watched movies:
M4 Superman 27-10-2017 10:00:00
# ERROR data
getWatchedMovie(111111A, 31-12-2018 10:00:00)
ERROR: There are no watched movies
# Expected: M2
getWatchedMovie(111111A, 26-10-2017 20:00:00)
M2 Star Wars: Episode V - The Empire Strikes Back 26-10-2017 20:00:00
# Expected: M5
getWatchedMovie(111111A, 07-10-2017 10:00:00)
M5 Gone with the Wind 07-10-2017 10:00:00
# Expected: M4
getWatchedMovie(111111A, 01-10-2017 10:00:00)
M4 Superman 01-10-2017 10:00:00
# Expected M7
getWatchedMovie(333333C, 31-10-2017 10:00:00)
M7 Star Wars VIII – The Last Jedi 31-10-2017 10:00:00
rateMovie(M2, 85)
void
getMovie(M2)
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 85
rateMovie(M2, 90)
void
getMovie(M2)
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 90
rateMovie(M2, 95)
void
getMovie(M2)
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 95
rateMovie(M2, 70)
void
getMovie(M2)
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 70
bestRated()
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 70
# ERROR
bestRated()
ERROR: There are no movies
rateMovie(M5, 70)
void
rateMovie(M4, 27)
void
rateMovie(M2, 90)
void
rateMovie(M1, 10)
void
bestRated()
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 90
bestRated()
idMovie:M5
title: Gone with the Wind
director: Victor Fleming
duration: 221
views: 1
rating: 70
bestRated()
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 2
rating: 27
bestRated()
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 1
rating: 10
# ERROR
bestRated()
ERROR: There are no movies
rateMovie(M2, 98)
void
rateMovie(M4, 28)
void
rateMovie(M5, 77)
void
rateMovie(M1, 100)
void
movies()
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 1
rating: 100
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 98
idMovie:M3
title: Star Wars: Episode VI - Return of the Jedi
director: Richard Marquand
duration: 124
views: 0
rating: 0
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 2
rating: 28
idMovie:M5
title: Gone with the Wind
director: Victor Fleming
duration: 221
views: 1
rating: 77
idMovie:M6
title: Star Wars: Episode VII – The Force Awakens
director: J. J. Abrams
duration: 135
views: 0
rating: 0
idMovie:M7
title: Star Wars VIII – The Last Jedi
director: Rian Johnson
duration: 152
views: 1
rating: 0
bestRated()
idMovie:M1
title: Star Wars: Episode IV - A New Hope
director: George Lucas
duration: 121
views: 1
rating: 100
bestRated()
idMovie:M2
title: Star Wars: Episode V - The Empire Strikes Back
director: Irvin Kershner
duration: 124
views: 3
rating: 98
bestRated()
idMovie:M5
title: Gone with the Wind
director: Victor Fleming
duration: 221
views: 1
rating: 77
bestRated()
idMovie:M4
title: Superman
director: Richard Donner
duration: 143
views: 2
rating: 28