mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-23 16:41:38 +01:00
More testing
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1501 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
bb804a5710
commit
4c52cefcb0
@ -83,6 +83,7 @@ public class EconomyTest extends TestCase
|
||||
}
|
||||
|
||||
//test Format
|
||||
assertEquals("$1000", Economy.format(1000.0));
|
||||
assertEquals("$10", Economy.format(10.0));
|
||||
assertEquals("$10.10", Economy.format(10.10));
|
||||
assertEquals("$10.10", Economy.format(10.102));
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import junit.framework.TestCase;
|
||||
@ -8,12 +10,28 @@ import junit.framework.TestCase;
|
||||
public class UtilTest extends TestCase
|
||||
{
|
||||
public void testFDDnow() {
|
||||
try
|
||||
{
|
||||
Util.updateLocale("en_US", File.createTempFile("test1", "").getParentFile());
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
Calendar c = new GregorianCalendar();
|
||||
String resp = Util.formatDateDiff(c, c);
|
||||
assertEquals(resp, "now");
|
||||
}
|
||||
|
||||
public void testFDDfuture() {
|
||||
try
|
||||
{
|
||||
Util.updateLocale("en_US", File.createTempFile("test2", "").getParentFile());
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
Calendar a, b;
|
||||
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
||||
b = new GregorianCalendar(2010, 1, 1, 10, 0, 1);
|
||||
@ -78,6 +96,14 @@ public class UtilTest extends TestCase
|
||||
}
|
||||
|
||||
public void testFDDpast() {
|
||||
try
|
||||
{
|
||||
Util.updateLocale("en_US", File.createTempFile("test3", "").getParentFile());
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
Calendar a, b;
|
||||
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
|
||||
b = new GregorianCalendar(2010, 1, 1, 9, 59, 59);
|
||||
|
Loading…
Reference in New Issue
Block a user