eu.lestard.assertj.javafx.api.ObservableObjectValueAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-javafx Show documentation
Show all versions of assertj-javafx Show documentation
AssertJ-JavaFX is a package of assertj assertions for JavaFX
The newest version!
package eu.lestard.assertj.javafx.api;
import eu.lestard.assertj.javafx.internal.ObservableValueAssertions;
import javafx.beans.value.ObservableObjectValue;
import org.assertj.core.api.AbstractAssert;
/**
* Assertion methods for {@link ObservableObjectValue}s.
*
* To create an instance of this class, invoke
* {@link eu.lestard.assertj.javafx.api.Assertions#assertThat(ObservableObjectValue)}
.
*
*
* @author manuel mauky
*/
public class ObservableObjectValueAssert extends AbstractAssert, ObservableObjectValue> {
protected ObservableObjectValueAssert(ObservableObjectValue actual) {
super(actual, ObservableObjectValueAssert.class);
}
/**
* Verifies that the actual observable has the expected value set.
*
* @param expectedValue the value to compare to the actual observables current value.
* @return {@code this} assertion instance.
*/
public ObservableObjectValueAssert hasValue(T expectedValue) {
new ObservableValueAssertions<>(actual).hasValue(expectedValue);
return this;
}
/**
* Verifies that the actual observable has a value of null
.
*
* @return {@code this} assertion instance.
*/
public ObservableObjectValueAssert hasNullValue() {
new ObservableValueAssertions<>(actual).hasNullValue();
return this;
}
/**
* Verifies that the actual observable has NOT a value of null
.
*
* @return {@code this} assertion instance.
*/
public ObservableObjectValueAssert hasNotNullValue() {
new ObservableValueAssertions<>(actual).hasNotNullValue();
return this;
}
/**
* Verifies that the actual observable has the same value as the given observable.
*
* @param expectedValue the observable value to compare with the actual observables current value.
*
* @return {@code this} assertion instance.
*/
public ObservableObjectValueAssert hasSameValue(ObservableObjectValue expectedValue) {
new ObservableValueAssertions<>(actual).hasSameValue(expectedValue);
return this;
}
}