org.assertj.android.api.animation.ObjectAnimatorAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
// Copyright 2013 Square, Inc.
package org.assertj.android.api.animation;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import static android.os.Build.VERSION_CODES.HONEYCOMB;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link ObjectAnimator} instances. */
@TargetApi(HONEYCOMB)
public class ObjectAnimatorAssert
extends AbstractValueAnimatorAssert {
public ObjectAnimatorAssert(ObjectAnimator actual) {
super(actual, ObjectAnimatorAssert.class);
}
public ObjectAnimatorAssert hasPropertyName(String name) {
isNotNull();
String actualName = actual.getPropertyName();
assertThat(actualName) //
.overridingErrorMessage("Expected property name <%s> but was <%s>.", name, actualName) //
.isEqualTo(name);
return this;
}
public ObjectAnimatorAssert hasTarget(Object target) {
isNotNull();
Object actualTarget = actual.getTarget();
assertThat(actualTarget) //
.overridingErrorMessage("Expected target <%s> but was <%s>.", target, actualTarget) //
.isSameAs(target);
return this;
}
}