Class FeatureTestCalculatorDuo
Object
org.anchoranalysis.test.feature.plugins.FeatureTestCalculatorDuo
public class FeatureTestCalculatorDuo extends Object
Utility class for testing features with both positive and negative cases.
This class provides methods to assert the results of feature calculations for both positive and negative inputs, supporting both double and integer results.
-
Method Summary
Modifier and Type Method Description static <T extends org.anchoranalysis.feature.input.FeatureInput>
voidassertDoubleResult(String message, org.anchoranalysis.feature.bean.Feature<T> feature, T inputPositive, T inputNegative, double expectedResultPositive, double expectedResultNegative)Asserts that a feature calculation results in expected double values for both positive and negative inputs.static <T extends org.anchoranalysis.feature.input.FeatureInput>
voidassertIntResult(String message, org.anchoranalysis.feature.bean.Feature<T> feature, T inputPositive, T inputNegative, int expectedResultPositive, int expectedResultNegative)Asserts that a feature calculation results in expected integer values for both positive and negative inputs.
-
Method Details
-
assertDoubleResult
public static <T extends org.anchoranalysis.feature.input.FeatureInput> void assertDoubleResult(String message, org.anchoranalysis.feature.bean.Feature<T> feature, T inputPositive, T inputNegative, double expectedResultPositive, double expectedResultNegative) throws org.anchoranalysis.feature.calculate.FeatureCalculationExceptionAsserts that a feature calculation results in expected double values for both positive and negative inputs.- Type Parameters:
T- the type of feature input- Parameters:
message- the base assertion messagefeature- the feature to calculateinputPositive- the positive input for the feature calculationinputNegative- the negative input for the feature calculationexpectedResultPositive- the expected result for the positive inputexpectedResultNegative- the expected result for the negative input- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException- if the feature calculation fails
-
assertIntResult
public static <T extends org.anchoranalysis.feature.input.FeatureInput> void assertIntResult(String message, org.anchoranalysis.feature.bean.Feature<T> feature, T inputPositive, T inputNegative, int expectedResultPositive, int expectedResultNegative) throws org.anchoranalysis.feature.calculate.FeatureCalculationExceptionAsserts that a feature calculation results in expected integer values for both positive and negative inputs.- Type Parameters:
T- the type of feature input- Parameters:
message- the base assertion messagefeature- the feature to calculateinputPositive- the positive input for the feature calculationinputNegative- the negative input for the feature calculationexpectedResultPositive- the expected result for the positive inputexpectedResultNegative- the expected result for the negative input- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException- if the feature calculation fails
-