@@ -13,38 +13,43 @@ public class EnvelopeStopWrapperTests {
13
13
@ Test
14
14
public void iteratePointsWithoutStops () {
15
15
var envelopeFloor = Envelope .make (EnvelopeTestUtils .generateTimes (
16
- new double [] {0 , 1 , 2 , 3 , 4 , 5 , 6 }, new double [] {1 , 1 , 1 , 1 , 1 , 1 , 1 }));
16
+ new double [] {0 , 1 , 2 , 3 , 4 , 5 , 6 }, new double [] {1 , 1 , 1 , 1 , 1 , 1 , 1 }));
17
17
var envelopeStopWrapper = new EnvelopeStopWrapper (envelopeFloor , List .of ());
18
18
Assertions .assertEquals (
19
- List .of (
20
- new EnvelopeTimeInterpolate .EnvelopePoint (0 , 1 , 0 ),
21
- new EnvelopeTimeInterpolate .EnvelopePoint (1 , 1 , 1 ),
22
- new EnvelopeTimeInterpolate .EnvelopePoint (2 , 1 , 2 ),
23
- new EnvelopeTimeInterpolate .EnvelopePoint (3 , 1 , 3 ),
24
- new EnvelopeTimeInterpolate .EnvelopePoint (4 , 1 , 4 ),
25
- new EnvelopeTimeInterpolate .EnvelopePoint (5 , 1 , 5 ),
26
- new EnvelopeTimeInterpolate .EnvelopePoint (6 , 1 , 6 )),
27
- envelopeStopWrapper .iteratePoints ());
19
+ List .of (
20
+ new EnvelopeTimeInterpolate .EnvelopePoint (0 , 1 , 0 ),
21
+ new EnvelopeTimeInterpolate .EnvelopePoint (1 , 1 , 1 ),
22
+ new EnvelopeTimeInterpolate .EnvelopePoint (2 , 1 , 2 ),
23
+ new EnvelopeTimeInterpolate .EnvelopePoint (3 , 1 , 3 ),
24
+ new EnvelopeTimeInterpolate .EnvelopePoint (4 , 1 , 4 ),
25
+ new EnvelopeTimeInterpolate .EnvelopePoint (5 , 1 , 5 ),
26
+ new EnvelopeTimeInterpolate .EnvelopePoint (6 , 1 , 6 )),
27
+ envelopeStopWrapper .iteratePoints ());
28
28
}
29
29
30
30
@ Test
31
31
public void iteratePointsWithStops () {
32
32
var envelopeFloor = Envelope .make (EnvelopeTestUtils .generateTimes (
33
- new double [] {0 , 1 , 2 , 3 , 4 , 5 , 6 }, new double [] {1 , 1 , 1 , 0 , 1 , 1 , 1 }));
33
+ new double [] {0 , 1 , 2 , 3 , 4 , 5 , 6 }, new double [] {1 , 1 , 1 , 0 , 1 , 1 , 1 }));
34
34
var envelopeStopWrapper = new EnvelopeStopWrapper (
35
- envelopeFloor ,
36
- List .of (
37
- new TrainStop (1.5 , 0 , RJSReceptionSignal .OPEN ),
38
- new TrainStop (3 , 10 , RJSReceptionSignal .SHORT_SLIP_STOP )));
35
+ envelopeFloor ,
36
+ List .of (
37
+ new TrainStop (3 , 10 , RJSReceptionSignal .SHORT_SLIP_STOP ),
38
+ new TrainStop (6 , 5 , RJSReceptionSignal .OPEN )
39
+ )
40
+ );
39
41
Assertions .assertEquals (
40
- List .of (
41
- new EnvelopeTimeInterpolate .EnvelopePoint (0 , 1 , 0 ),
42
- new EnvelopeTimeInterpolate .EnvelopePoint (1 , 1 , 1 ),
43
- new EnvelopeTimeInterpolate .EnvelopePoint (2 , 1 , 2 ),
44
- new EnvelopeTimeInterpolate .EnvelopePoint (4 , 0 , 3 ),
45
- new EnvelopeTimeInterpolate .EnvelopePoint (6 + 10 , 1 , 4 ),
46
- new EnvelopeTimeInterpolate .EnvelopePoint (7 + 10 , 1 , 5 ),
47
- new EnvelopeTimeInterpolate .EnvelopePoint (8 + 10 , 1 , 6 )),
48
- envelopeStopWrapper .iteratePoints ());
42
+ List .of (
43
+ new EnvelopeTimeInterpolate .EnvelopePoint (0 , 1 , 0 ),
44
+ new EnvelopeTimeInterpolate .EnvelopePoint (1 , 1 , 1 ),
45
+ new EnvelopeTimeInterpolate .EnvelopePoint (2 , 1 , 2 ),
46
+ new EnvelopeTimeInterpolate .EnvelopePoint (4 , 0 , 3 ),
47
+ new EnvelopeTimeInterpolate .EnvelopePoint (4 + 10 , 0 , 3 ),
48
+ new EnvelopeTimeInterpolate .EnvelopePoint (6 + 10 , 1 , 4 ),
49
+ new EnvelopeTimeInterpolate .EnvelopePoint (7 + 10 , 1 , 5 ),
50
+ new EnvelopeTimeInterpolate .EnvelopePoint (8 + 10 , 1 , 6 ),
51
+ new EnvelopeTimeInterpolate .EnvelopePoint (8 + 10 + 5 , 1 , 6 )),
52
+ envelopeStopWrapper .iteratePoints ().stream ().distinct ().toList ()
53
+ );
49
54
}
50
55
}
0 commit comments