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

org.fest.assertions.api.android.view.animation.AnimationSetAssert Maven / Gradle / Ivy

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

import android.view.animation.AnimationSet;

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

/** Assertions for {@link AnimationSet} instances. */
public class AnimationSetAssert extends AbstractAnimationAssert {
  public AnimationSetAssert(AnimationSet actual) {
    super(actual, AnimationSetAssert.class);
  }

  public AnimationSetAssert hasDurationHint(long duration) {
    isNotNull();
    long actualDuration = actual.computeDurationHint();
    assertThat(actualDuration) //
        .overridingErrorMessage("Expected duration hint <%s> but was <%s>.", duration,
            actualDuration) //
        .isEqualTo(duration);
    return this;
  }

  public AnimationSetAssert hasAnimationCount(int count) {
    isNotNull();
    int actualCount = actual.getAnimations().size();
    assertThat(actualCount) //
        .overridingErrorMessage("Expected animation count <%s> but was <%s>.", count,
            actualCount) //
        .isEqualTo(count);
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy