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

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

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

import eu.lestard.assertj.javafx.internal.BindingAssertions;
import eu.lestard.assertj.javafx.internal.ObservableValueAssertions;
import javafx.beans.Observable;
import javafx.beans.binding.Binding;
import javafx.beans.value.ObservableValue;
import org.assertj.core.api.AbstractAssert;


/**
 * Assertion methods for {@link Binding}s.
 *
 * 

To create an instance of this class, invoke * {@link eu.lestard.assertj.javafx.api.Assertions#assertThat(Binding)}. *

* * @author manuel mauky */ public class BindingAssert extends AbstractAssert, Binding> { protected BindingAssert(Binding actual) { super(actual, BindingAssert.class); } /** * Verifies that the actual Binding is bound and depends on the given Observable value. * * @param observable the observable that is expected to be a binding dependency of the actual binding. * @return {@code this} assertion instance */ public BindingAssert dependsOn(Observable observable) { new BindingAssertions<>(actual).dependsOn(observable); return this; } /** * Verifies that the actual binding has the expected value set. * * @param expectedValue the value to compare to the actual bindings current value. * @return {@code this} assertion instance. */ public BindingAssert hasValue(T expectedValue){ new BindingAssertions<>(actual).hasValue(expectedValue); return this; } /** * Verifies that the actual binding has a value of null. * * @return {@code this} assertion instance. */ public BindingAssert hasNullValue(){ new BindingAssertions<>(actual).hasNullValue(); return this; } /** * Verifies that the actual binding has NOT a value of null. * * @return {@code this} assertion instance. */ public BindingAssert hasNotNullValue(){ new BindingAssertions<>(actual).hasNotNullValue(); return this; } /** * Verifies that the actual binding has the same value as the given observable. * * @param expectedValue the observable value to compare with the actual bindings current value. * * @return {@code this} assertion instance. */ public BindingAssert hasSameValue(ObservableValue expectedValue) { new ObservableValueAssertions<>(actual).hasSameValue(expectedValue); return this; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy