Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

added test for date comparison for max january vs max february #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/iii_conventions/N25ComparisonKtTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class N25ComparisonKtTest {
assertTrue("The date ${first.s} should be after ${second.s}", first > second)
}

@Test fun testMaxJanuaryBeforeMaxFebruaryNotLeapYear() {
val first = MyDate(2015, 1, 31)
val second = MyDate(2015, 2, 28)
assertTrue("The date ${first.s} should be before ${second.s}", first < second)
}

/* If you declare 'compareTo' as an extension function, remove this one to make the code compile */
operator fun MyDate.compareTo(other: MyDate): Int = todoTask25()
}