All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.lestard.assertj.javafx.api.Assertions Maven / Gradle / Ivy

The newest version!
package eu.lestard.assertj.javafx.api;

import javafx.beans.binding.*;
import javafx.beans.property.*;
import javafx.beans.value.*;

/**
 * This is the central entry point for assertions for assertj-javafx.
 *
 * @author Manuel Mauky
 */
public class Assertions {

    /*************************************************************************/
    // Bindings
    /*************************************************************************/


    /**
     * Creates a new instance of {@link NumberBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static NumberBindingAssert assertThat(NumberBinding actual){
        return new NumberBindingAssert(actual);
    }


    /**
     * Creates a new instance of {@link BindingAssert}.
     *
     * @param     the generic type of the binding.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static  BindingAssert assertThat(Binding actual) {
        return new BindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link BooleanBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static BooleanBindingAssert assertThat(BooleanBinding actual) {
        return new BooleanBindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link DoubleBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static DoubleBindingAssert assertThat(DoubleBinding actual) {
        return new DoubleBindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link FloatBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static FloatBindingAssert assertThat(FloatBinding actual) {
        return new FloatBindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link IntegerBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static IntegerBindingAssert assertThat(IntegerBinding actual) {
        return new IntegerBindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link LongBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static LongBindingAssert assertThat(LongBinding actual) {
        return new LongBindingAssert(actual);
    }


    /**
     * Creates a new instance of {@link StringBindingAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static StringBindingAssert assertThat(StringBinding actual) {
        return new StringBindingAssert(actual);
    }

    /**
     * Creates a new instance of {@link ObjectBindingAssert}.
     *
     * @param     the generic type of the object binding.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static  ObjectBindingAssert assertThat(ObjectBinding actual) {
        return new ObjectBindingAssert<>(actual);
    }

    /*************************************************************************/
    // ObservableValues
    /*************************************************************************/


    /**
     * Creates a new instance of {@link ObservableNumberValueAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ObservableNumberValueAssert assertThat(ObservableNumberValue actual) {
        return new ObservableNumberValueAssert(actual);
    }

    /**
     * Creates a new instance of {@link ObservableBooleanValueAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ObservableBooleanValueAssert assertThat(ObservableBooleanValue actual) {
        return new ObservableBooleanValueAssert(actual);
    }

    /**
     * Creates a new instance of {@link ObservableStringValueAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ObservableStringValueAssert assertThat(ObservableStringValue actual) {
        return new ObservableStringValueAssert(actual);
    }

    /**
     * Creates a new instance of {@link ObservableObjectValueAssert}.
     *
     * @param     the generic type of the observable object value.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static  ObservableObjectValueAssert assertThat(ObservableObjectValue actual) {
        return new ObservableObjectValueAssert<>(actual);
    }


    public static  ObservableValueAssert assertThat(ObservableValue actual) {
        return new ObservableValueAssert<>(actual);
    }

    /*************************************************************************/
    // Properties
    /*************************************************************************/


    /**
     * Creates a new instance of {@link BooleanPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static BooleanPropertyAssert assertThat(BooleanProperty actual) {
        return new BooleanPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link DoublePropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static DoublePropertyAssert assertThat(DoubleProperty actual) {
        return new DoublePropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link FloatPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static FloatPropertyAssert assertThat(FloatProperty actual) {
        return new FloatPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link IntegerPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static IntegerPropertyAssert assertThat(IntegerProperty actual) {
        return new IntegerPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link LongPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static LongPropertyAssert assertThat(LongProperty actual) {
        return new LongPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link StringPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static StringPropertyAssert assertThat(StringProperty actual) {
        return new StringPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ObjectPropertyAssert}.
     *
     * @param     the generic type of the object property.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static  ObjectPropertyAssert assertThat(ObjectProperty actual) {
        return new ObjectPropertyAssert<>(actual);
    }

    /*************************************************************************/
    // ReadOnly Properties
    /*************************************************************************/


    /**
     * Creates a new instance of {@link ReadOnlyBooleanPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyBooleanPropertyAssert assertThat(ReadOnlyBooleanProperty actual) {
        return new ReadOnlyBooleanPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyDoublePropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyDoublePropertyAssert assertThat(ReadOnlyDoubleProperty actual) {
        return new ReadOnlyDoublePropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyFloatPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyFloatPropertyAssert assertThat(ReadOnlyFloatProperty actual) {
        return new ReadOnlyFloatPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyIntegerPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyIntegerPropertyAssert assertThat(ReadOnlyIntegerProperty actual) {
        return new ReadOnlyIntegerPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyLongPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyLongPropertyAssert assertThat(ReadOnlyLongProperty actual) {
        return new ReadOnlyLongPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyStringPropertyAssert}.
     *
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static ReadOnlyStringPropertyAssert assertThat(ReadOnlyStringProperty actual) {
        return new ReadOnlyStringPropertyAssert(actual);
    }

    /**
     * Creates a new instance of {@link ReadOnlyObjectPropertyAssert}.
     *
     * @param     the generic type of the object property.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    public static  ReadOnlyObjectPropertyAssert assertThat(ReadOnlyObjectProperty actual) {
        return new ReadOnlyObjectPropertyAssert<>(actual);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy