Skip to content

Commit e8a1867

Browse files
committed
Ported commented test
1 parent 411e0b8 commit e8a1867

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

shared/src/test/scala/org/threeten/bp/temporal/TestMonthDay.scala

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,14 @@ class TestMonthDay extends GenDateTimeTest with BeforeAndAfter {
584584
assertEquals(TEST_07_15 == null, false)
585585
}
586586

587-
/*@Test(dataProvider = "sampleDates") def test_hashCode(m: Int, d: Int): Unit = {
588-
val a: MonthDay = MonthDay.of(m, d)
589-
assertEquals(a.hashCode, a.hashCode)
590-
val b: MonthDay = MonthDay.of(m, d)
591-
assertEquals(a.hashCode, b.hashCode)
587+
test("test_hashCode") {
588+
provider_sampleDates.foreach {
589+
case (m, d) =>
590+
val a: MonthDay = MonthDay.of(m, d)
591+
assertEquals(a.hashCode, a.hashCode)
592+
val b: MonthDay = MonthDay.of(m, d)
593+
assertEquals(a.hashCode, b.hashCode)
594+
}
592595
}
593596

594597
test("test_hashCode_unique") {
@@ -607,15 +610,21 @@ class TestMonthDay extends GenDateTimeTest with BeforeAndAfter {
607610
}
608611
}
609612

610-
@DataProvider(name = "sampleToString") private[temporal] def provider_sampleToString: Array[Array[Any]] = {
611-
Array[Array[Any]](Array(7, 5, "--07-05"), Array(12, 31, "--12-31"), Array(1, 2, "--01-02"))
613+
val provider_sampleToString: List[(Int, Int, String)] = {
614+
List(
615+
(7, 5, "--07-05"),
616+
(12, 31, "--12-31"),
617+
(1, 2, "--01-02"))
612618
}
613619

614-
@Test(dataProvider = "sampleToString") def test_toString(m: Int, d: Int, expected: String): Unit = {
615-
val test: MonthDay = MonthDay.of(m, d)
616-
val str: String = test.toString
617-
assertEquals(str, expected)
618-
}*/
620+
test("test_toString") {
621+
provider_sampleToString.foreach {
622+
case (m, d, expected) =>
623+
val test: MonthDay = MonthDay.of(m, d)
624+
val str: String = test.toString
625+
assertEquals(str, expected)
626+
}
627+
}
619628

620629
test("test_format_formatter") {
621630
val f: DateTimeFormatter = DateTimeFormatter.ofPattern("M d")

0 commit comments

Comments
 (0)