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>
    void
    assertDoubleResult​(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>
    void
    assertIntResult​(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.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 message
      feature - the feature to calculate
      inputPositive - the positive input for the feature calculation
      inputNegative - the negative input for the feature calculation
      expectedResultPositive - the expected result for the positive input
      expectedResultNegative - 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.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 message
      feature - the feature to calculate
      inputPositive - the positive input for the feature calculation
      inputNegative - the negative input for the feature calculation
      expectedResultPositive - the expected result for the positive input
      expectedResultNegative - the expected result for the negative input
      Throws:
      org.anchoranalysis.feature.calculate.FeatureCalculationException - if the feature calculation fails