コード例 #1
0
 /** Test of setEquals method, of class EqualsLastValue, for the value null. */
 @Test(expected = NullPointerException.class)
 public void testSetEquals_Null() {
   System.out.println("setEquals(null)");
   Equals<Double> equality = null;
   EqualsLastValue instance = this._double;
   instance.setEquals(equality);
   fail("No exception thrown.");
 }
コード例 #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.");
 }