/**
 * 
 */
package org.josast.equationKepler;

import org.josast.equationKepler.Kepler;
import org.josast.equationKepler.KeplerFixPpoint;
import org.josast.equationKepler.KeplerNewton;

import junit.framework.Assert;
import junit.framework.TestCase;

/**
 * @author cmercier
 *
 */
public class KeplerTest extends TestCase {

	/**
	 * @param name
	 */
	public KeplerTest(String name) {
		super(name);
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#tearDown()
	 */
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	/**
	 * Test method for {@link org.josast.equationKepler.Kepler#calcul(double, double)}.
	 */
	public final void testCalcul() {
		  Kepler K = new KeplerFixPpoint();
		  Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728,0.0000001);
		  Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.24318719636991842,0.0000001);
		  Assert.assertEquals(K.getEpsilon(),1.0e-14,1.0e-14);
		  K = new KeplerNewton();
		  Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728,0.0000001);
		  Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.2431871963699407,0.0000001);
		  Assert.assertEquals(K.getEpsilon(),1.0e-14,1.0e-14);
	}

}
