Skip to content

Commit

Permalink
add weird test inluding unfixable one due to format
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoniecz committed Mar 6, 2020
1 parent a17bfd9 commit 687894c
Showing 1 changed file with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OpeningHoursModelCreatorTest {
assertEquals(expected, actual)
}

@Test fun `does not merge opening weekdays rows of same day is separated by another day`() {
@Test fun `does not merge opening weekdays rows of same day when separated by another day`() {
val actual = create(
OpeningWeekdaysRow(monday, morning),
OpeningWeekdaysRow(tuesday, morning),
Expand All @@ -73,6 +73,34 @@ class OpeningHoursModelCreatorTest {
assertEquals(expected, actual)
}

@Test fun `does merge overlapping opening weekdays rows of same day is separated by another day`() {
val actual = create(
OpeningWeekdaysRow(monday, morning),
OpeningWeekdaysRow(monday, midday)
)

val expected = months(OpeningMonths(wholeYear, clusters(
weekdays(OpeningWeekdays(monday, times(morning, midday)))
)))
assertEquals(expected, actual)
}

@Test fun `does not merge overlapping opening weekdays rows of same day is separated by another day`() {
val actual = create(
OpeningWeekdaysRow(monday, morning),
OpeningWeekdaysRow(tuesday, morning),
OpeningWeekdaysRow(monday, midday)
)

val expected = months(OpeningMonths(wholeYear, clusters(
weekdays(OpeningWeekdays(monday, times(morning))),
weekdays(OpeningWeekdays(tuesday, times(morning))),
weekdays(OpeningWeekdays(monday, times(midday)))
)))

assertEquals(expected, actual)
}

@Test fun `does not cluster different weekdays`() {
val actual = create(
OpeningWeekdaysRow(monday, morning),
Expand Down

0 comments on commit 687894c

Please sign in to comment.