org.testng.internal.junit.InexactComparisonCriteria Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testng Show documentation
Show all versions of testng Show documentation
A testing framework for the JVM
package org.testng.internal.junit;
import org.testng.AssertJUnit;
public class InexactComparisonCriteria extends ComparisonCriteria {
public final double fDelta;
public InexactComparisonCriteria(double delta) {
fDelta = delta;
}
@Override
protected void assertElementsEqual(Object expected, Object actual) {
if (expected instanceof Double)
AssertJUnit.assertEquals((Double) expected, (Double) actual, fDelta);
else AssertJUnit.assertEquals((Float) expected, (Float) actual, fDelta);
}
}