mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-22 19:31:54 +00:00
Fix unit tests.
This commit is contained in:
parent
2ddd31a37d
commit
98b716dfbf
|
@ -98,10 +98,10 @@ public class UtilTest extends TestCase
|
||||||
assertEquals("3 years", Util.formatDateDiff(a, b));
|
assertEquals("3 years", Util.formatDateDiff(a, b));
|
||||||
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
||||||
b = new GregorianCalendar(2011, 4, 5, 23, 38, 12);
|
b = new GregorianCalendar(2011, 4, 5, 23, 38, 12);
|
||||||
assertEquals(" 1 year 3 months 4 days 13 hours 38 minutes 12 seconds", Util.formatDateDiff(a, b));
|
assertEquals("1 year 3 months 4 days", Util.formatDateDiff(a, b));
|
||||||
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
||||||
b = new GregorianCalendar(2015, 3, 7, 10, 0, 0);
|
b = new GregorianCalendar(2015, 3, 7, 10, 0, 0);
|
||||||
assertEquals(" 4 years 5 months 20 days 10 hours 14 minutes 15 seconds", Util.formatDateDiff(a, b));
|
assertEquals("4 years 5 months 20 days", Util.formatDateDiff(a, b));
|
||||||
a = new GregorianCalendar(2011, 4, 31, 10, 0, 0);
|
a = new GregorianCalendar(2011, 4, 31, 10, 0, 0);
|
||||||
b = new GregorianCalendar(2011, 4, 31, 10, 5, 0);
|
b = new GregorianCalendar(2011, 4, 31, 10, 5, 0);
|
||||||
assertEquals("5 minutes", Util.formatDateDiff(a, b));
|
assertEquals("5 minutes", Util.formatDateDiff(a, b));
|
||||||
|
@ -166,9 +166,9 @@ public class UtilTest extends TestCase
|
||||||
assertEquals("3 years", Util.formatDateDiff(a, b));
|
assertEquals("3 years", Util.formatDateDiff(a, b));
|
||||||
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
||||||
b = new GregorianCalendar(2009, 4, 5, 23, 38, 12);
|
b = new GregorianCalendar(2009, 4, 5, 23, 38, 12);
|
||||||
assertEquals(" 8 months 26 days 10 hours 21 minutes 48 seconds", Util.formatDateDiff(a, b));
|
assertEquals("8 months 26 days 10 hours", Util.formatDateDiff(a, b));
|
||||||
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
a = new GregorianCalendar(2010, 9, 17, 23, 45, 45);
|
||||||
b = new GregorianCalendar(2000, 3, 7, 10, 0, 0);
|
b = new GregorianCalendar(2000, 3, 7, 10, 0, 0);
|
||||||
assertEquals(" 10 years 6 months 10 days 13 hours 45 minutes 45 seconds", Util.formatDateDiff(a, b));
|
assertEquals("10 years 6 months 10 days", Util.formatDateDiff(a, b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue