Ejemplo n.º 1
0
 /** Test of getEquals method, of class EqualsLastValue. */
 @Test
 public void testGetEquals() {
   System.out.println("getEquals");
   EqualsLastValue instance = this._double;
   double precision = Math.pow(10.0, -10.0);
   Equals<Double> result = instance.getEquals();
   if (result instanceof DoubleAbsolute) {
     DoubleAbsolute da = (DoubleAbsolute) result;
     double resultPrecision = da.getPrecision();
     assertEquals("Wrong value of precision from equality.", precision, resultPrecision, 0.0);
   } else fail("Wrong kind of equality returned.");
 }
Ejemplo n.º 2
0
 /** Test of setEquals method, of class EqualsLastValue. */
 @Test
 public void testSetEquals() {
   System.out.println("setEquals");
   double precision = Math.pow(10.0, -8.0);
   Equals<Double> equality = new DoubleRelative(precision);
   EqualsLastValue instance = this._double;
   instance.setEquals(equality);
   Equals<Double> result = instance.getEquals();
   if (result instanceof DoubleRelative) {
     DoubleRelative dr = (DoubleRelative) result;
     double resultPrecision = dr.getPrecision();
     assertEquals("Wrong value of precision from equality.", precision, resultPrecision, 0.0);
   } else fail("Wrong kind of equality returned.");
 }