Add MUOMTest test case

This commit is contained in:
teo_sarca 2008-07-28 13:48:34 +00:00
parent 1912256998
commit a1130e75f7
2 changed files with 33 additions and 0 deletions

View File

@ -19,6 +19,7 @@ public class FunctionalTestSuite {
suite.addTestSuite(MSysConfigTest.class);
suite.addTestSuite(QueryTest.class);
suite.addTestSuite(MRefListTest.class);
suite.addTestSuite(MUOMTest.class);
//$JUnit-END$
return suite;
}

View File

@ -0,0 +1,32 @@
/**
*
*/
package test.functional;
import org.compiere.model.MUOM;
import org.compiere.util.Ini;
import test.AdempiereTestCase;
/**
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
*
*/
public class MUOMTest extends AdempiereTestCase {
public void testGet() throws Exception {
assertEquals("UOM not found", "EA", MUOM.get(getCtx(), 100).getX12DE355());
assertEquals("UOM not found", "HR", MUOM.get(getCtx(), 101).getX12DE355());
assertEquals("UOM not found", "MJ", MUOM.get(getCtx(), 103).getX12DE355());
}
public void testGetMinute_UOM_ID() throws Exception {
int uom_id = MUOM.getMinute_UOM_ID(getCtx());
assertTrue("Not Minute UOM (client="+Ini.isClient()+")", MUOM.get(getCtx(), uom_id).isMinute());
//
Ini.setClient(!Ini.isClient());
uom_id = MUOM.getMinute_UOM_ID(getCtx());
assertTrue("Not Minute UOM (client="+Ini.isClient()+")", MUOM.get(getCtx(), uom_id).isMinute());
//
Ini.setClient(!Ini.isClient());
}
}