Annotation Type FloatRangeSource


@Target({METHOD,PARAMETER}) @Retention(RUNTIME) @Documented @ArgumentsSource(org.junitpioneer.jupiter.params.RangeSourceArgumentsProvider.class) @RangeClass(org.junitpioneer.jupiter.params.FloatRange.class) @Repeatable(FloatRangeSources.class) public @interface FloatRangeSource
@FloatRangeSource is an ArgumentsSource that provides access to a range of float values.

The supplied values will be provided as arguments to the annotated @ParameterizedTest method.

For more details and examples, see the documentation on Range Sources

This annotation is Repeatable, to make it usable with CartesianProductTest. If used with ParameterizedTest, it can only be used once (because ParameterizedTest can only take a single ArgumentsSource). Using it more than once will throw an IllegalArgumentException. If used with CartesianProductTest, it can be repeated to provide arguments to more than one parameter.

This annotation can be used on a method parameter, to make it usable with CartesianTest. If used with ParameterizedTest, the annotation has to be on the method itself as any other ArgumentsSource.

For more details and examples, see the documentation on Cartesian product tests

Since:
0.5
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Containing annotation of repeatable FloatRangeSource.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    float
    The starting point of the range, inclusive.
    float
    The end point of the range, exclusive.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the range is closed (inclusive of the to()) or not.
    float
    The size of the step between the from and the to.
  • Element Details

    • from

      float from
      The starting point of the range, inclusive.
    • to

      float to
      The end point of the range, exclusive.
    • step

      float step
      The size of the step between the from and the to.
      Default:
      1.0f
    • closed

      boolean closed
      Whether the range is closed (inclusive of the to()) or not.
      Default:
      false