@@ -24,8 +24,8 @@ class WeekViewEventTest {
2424
2525 @Test
2626 fun `single-day event is recognized correctly` () {
27- val startTime = (today() + Days (1 )).withHour(6 ).withMinutes(0 )
28- val endTime = startTime + Hours (10 )
27+ val startTime = (today().plusDays (1 )).withHour(6 ).withMinutes(0 )
28+ val endTime = startTime.plusHours (10 )
2929
3030 val originalEvent = Mocks .weekViewItem(startTime, endTime)
3131
@@ -39,8 +39,8 @@ class WeekViewEventTest {
3939
4040 @Test
4141 fun `two-day event is recognized correctly` () {
42- val startTime = (today() + Days (1 )).withHour(14 ).withMinutes(0 )
43- val endTime = (today() + Days (2 )).withHour(14 ).withMinutes(0 )
42+ val startTime = (today().plusDays (1 )).withHour(14 ).withMinutes(0 )
43+ val endTime = (today().plusDays (2 )).withHour(14 ).withMinutes(0 )
4444
4545 val originalEvent = Mocks .weekViewItem(startTime, endTime)
4646 val eventChips = factory.create(listOf (originalEvent), viewState)
@@ -58,8 +58,8 @@ class WeekViewEventTest {
5858
5959 @Test
6060 fun `multi-day event is recognized correctly` () {
61- val startTime = (today() + Days (1 )).withHour(14 ).withMinutes(0 )
62- val endTime = (today() + Days (3 )).withHour(1 ).withMinutes(0 )
61+ val startTime = (today().plusDays (1 )).withHour(14 ).withMinutes(0 )
62+ val endTime = (today().plusDays (3 )).withHour(1 ).withMinutes(0 )
6363
6464 val originalEvent = Mocks .weekViewItem(startTime, endTime)
6565 val eventChips = factory.create(listOf (originalEvent), viewState)
@@ -79,11 +79,11 @@ class WeekViewEventTest {
7979 @Test
8080 fun `non-colliding events are recognized correctly` () {
8181 val firstStartTime = now()
82- val firstEndTime = firstStartTime + Hours (1 )
82+ val firstEndTime = firstStartTime.plusHours (1 )
8383 val first = Mocks .weekViewItem(firstStartTime, firstEndTime)
8484
85- val secondStartTime = firstStartTime + Hours (2 )
86- val secondEndTime = secondStartTime + Hours (1 )
85+ val secondStartTime = firstStartTime.plusHours (2 )
86+ val secondEndTime = secondStartTime.plusHours (1 )
8787 val second = Mocks .weekViewItem(secondStartTime, secondEndTime)
8888
8989 assertFalse(first.collidesWith(second))
@@ -92,11 +92,11 @@ class WeekViewEventTest {
9292 @Test
9393 fun `overlapping events are recognized as colliding` () {
9494 val firstStartTime = now()
95- val firstEndTime = firstStartTime + Hours (1 )
95+ val firstEndTime = firstStartTime.plusHours (1 )
9696 val first = Mocks .weekViewItem(firstStartTime, firstEndTime)
9797
98- val secondStartTime = firstStartTime - Hours (1 )
99- val secondEndTime = firstEndTime + Hours (1 )
98+ val secondStartTime = firstStartTime.minusHours (1 )
99+ val secondEndTime = firstEndTime.plusHours (1 )
100100 val second = Mocks .weekViewItem(secondStartTime, secondEndTime)
101101
102102 assertTrue(first.collidesWith(second))
@@ -105,11 +105,11 @@ class WeekViewEventTest {
105105 @Test
106106 fun `partly-overlapping events are recognized as colliding` () {
107107 val firstStartTime = now().withMinutes(0 )
108- val firstEndTime = firstStartTime + Hours (1 )
108+ val firstEndTime = firstStartTime.plusHours (1 )
109109 val first = Mocks .weekViewItem(firstStartTime, firstEndTime)
110110
111111 val secondStartTime = firstStartTime.withMinutes(30 )
112- val secondEndTime = secondStartTime + Hours (1 )
112+ val secondEndTime = secondStartTime.plusHours (1 )
113113 val second = Mocks .weekViewItem(secondStartTime, secondEndTime)
114114
115115 assertTrue(first.collidesWith(second))
0 commit comments