@author
123124125126127128129130
} @Test public void testSecondAgo() throws Exception { PrettyTime t = newPrettyTimeWOJustNow(new Date(1000 * 1), locale); assertEquals("sekunti sitten", t.format(new Date(0))); }
130131132133134135136137
} @Test public void testMinutesFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("13 minuutin päästä", t.format(new Date(1000 * 60 * 13))); }
137138139140141142143144
} @Test public void testMinutesAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000 * 60 * 13), locale); assertEquals("13 minuuttia sitten", t.format(new Date(0))); }
144145146147148149150151
} @Test public void testMinuteFromNow() throws Exception { PrettyTime t = newPrettyTimeWOJustNow(new Date(0), locale); assertEquals("minuutin päästä", t.format(new Date(1000 * 60 * 1))); }
151152153154155156157158
} @Test public void testMinuteAgo() throws Exception { PrettyTime t = newPrettyTimeWOJustNow(new Date(1000 * 60 * 1), locale); assertEquals("minuutti sitten", t.format(new Date(0))); }
158159160161162163164165
} @Test public void testHoursFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("3 tunnin päästä", t.format(new Date(1000 * 60 * 60 * 3))); }
165166167168169170171172
} @Test public void testHoursAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 3), locale); assertEquals("3 tuntia sitten", t.format(new Date(0))); }
172173174175176177178179
} @Test public void testHoursFromNowSingle() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("tunnin päästä", t.format(new Date(1000 * 60 * 60 * 1))); }
179180181182183184185186
} @Test public void testHoursAgoSingle() throws Exception { PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 1), locale); assertEquals("tunti sitten", t.format(new Date(0))); }
186187188189190191192193
} @Test public void testDaysFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("3 päivän päästä", t.format(new Date(1000 * 60 * 60 * 24 * 3))); }