Class FeatureTestCalculatorDuo
Object
FeatureTestCalculatorDuo
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 TypeMethodDescriptionstatic <T extends FeatureInput>
voidassertDoubleResult
(String message, 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 FeatureInput>
voidassertIntResult
(String message, 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 FeatureInput> void assertDoubleResult(String message, Feature<T> feature, T inputPositive, T inputNegative, double expectedResultPositive, double expectedResultNegative) throws FeatureCalculationException Asserts 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:
FeatureCalculationException
- if the feature calculation fails
-
assertIntResult
public static <T extends FeatureInput> void assertIntResult(String message, Feature<T> feature, T inputPositive, T inputNegative, int expectedResultPositive, int expectedResultNegative) throws FeatureCalculationException Asserts 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:
FeatureCalculationException
- if the feature calculation fails
-