Skip to content

Commit

Permalink
Add regression tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed Jul 27, 2020
1 parent 22ce915 commit 39cda78
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.kizitonwose.calendarview.model.DayOwner
import com.kizitonwose.calendarview.ui.DayBinder
import com.kizitonwose.calendarview.ui.MonthHeaderFooterBinder
import com.kizitonwose.calendarview.ui.ViewContainer
import com.kizitonwose.calendarview.utils.Size
import com.kizitonwose.calendarview.utils.yearMonth
import com.kizitonwose.calendarviewsample.*
import org.junit.After
Expand Down Expand Up @@ -327,6 +328,19 @@ class CalenderViewTests {
sleep(3000)
}

@Test
fun deprecatedWidthAndHeightPropertiesWorkAsExpected() {
val calendarView = CalendarView(homeScreenRule.activity)
calendarView.dayWidth = 7
calendarView.dayHeight = 8
assertEquals(calendarView.daySize, Size(7, 8))

val calendarView2 = CalendarView(homeScreenRule.activity)
calendarView2.daySize = Size(10, 20)
assertEquals(calendarView2.dayWidth, calendarView2.daySize.width)
assertEquals(calendarView2.dayHeight, calendarView2.daySize.height)
}

private inline fun <reified T : Fragment> findFragment(): T {
return homeScreenRule.activity.supportFragmentManager
.findFragmentByTag(T::class.java.simpleName) as T
Expand Down

0 comments on commit 39cda78

Please sign in to comment.