package hirondelle.starfield.physics;
import hirondelle.starfield.util.Util;
import junit.framework.TestCase;
public final class DirectionOfMotionTEST extends TestCase {
public static void main(String args[]) {
String[] testCaseName = { DirectionOfMotionTEST.class.getName() };
junit.textui.TestRunner.main(testCaseName);
}
public DirectionOfMotionTEST(String aName) {
super(aName);
}
public void testIsDefault(){
testIsDef(0, 90, 0);
testIsDef(0, 90.000001, 0);
testIsDef(0.0, 90, 0);
testIsDef(0.0, 90, 0.0);
}
public void testIsNotDefault(){
testIsNotDef(0, 89, 0);
testIsNotDef(0.00001, 90, 0);
testIsNotDef(0, 90, 0.00001);
testIsNotDef(0, 90.00001, 0);
}
private void testIsDef(double aRA, double aDec, double aPhi){
DirectionOfMotion motion = new DirectionOfMotion(Util.radians(aRA), Util.radians(aDec), Util.radians(aPhi));
boolean isNotDef = motion.isNotDefault();
assertTrue(!isNotDef);
}
private void testIsNotDef(double aRA, double aDec, double aPhi){
DirectionOfMotion motion = new DirectionOfMotion(Util.radians(aRA), Util.radians(aDec), Util.radians(aPhi));
boolean isNotDef = motion.isNotDefault();
assertTrue(isNotDef);
}
}