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

org.fest.assertions.api.android.animation.ObjectAnimatorAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.animation;

import android.animation.ObjectAnimator;

import static org.fest.assertions.api.Assertions.assertThat;

/** Assertions for {@link ObjectAnimator} instances. */
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy