Home | History | Annotate | Download | only in junit
      1 package org.testng.internal.junit;
      2 
      3 import org.testng.AssertJUnit;
      4 
      5 public class InexactComparisonCriteria extends ComparisonCriteria {
      6     public double fDelta;
      7 
      8     public InexactComparisonCriteria(double delta) {
      9         fDelta= delta;
     10     }
     11 
     12     @Override
     13     protected void assertElementsEqual(Object expected, Object actual) {
     14         if (expected instanceof Double)
     15             AssertJUnit.assertEquals((Double)expected, (Double)actual, fDelta);
     16         else
     17             AssertJUnit.assertEquals((Float)expected, (Float)actual, fDelta);
     18     }
     19 }