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

org.fest.assertions.api.android.widget.AbstractAbsSeekBarAssert Maven / Gradle / Ivy

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

import android.graphics.drawable.Drawable;
import android.widget.AbsSeekBar;

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

public abstract class AbstractAbsSeekBarAssert, A extends AbsSeekBar>
    extends AbstractProgressBarAssert {
  protected AbstractAbsSeekBarAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  public S hasKeyProgressIncrement(int increment) {
    isNotNull();
    int actualIncrement = actual.getKeyProgressIncrement();
    assertThat(actualIncrement) //
        .overridingErrorMessage("Expected key progress increment <%s> but was <%s>.", increment,
            actualIncrement) //
        .isEqualTo(increment);
    return myself;
  }

  public S hasThumb(Drawable drawable) {
    isNotNull();
    Drawable actualDrawable = actual.getThumb();
    assertThat(actualDrawable) //
        .overridingErrorMessage("Expected thumb <%s> but was <%s>.", drawable, actualDrawable) //
        .isSameAs(drawable);
    return myself;
  }

  public S hasThumbOffset(int offset) {
    isNotNull();
    int actualOffset = actual.getThumbOffset();
    assertThat(actualOffset) //
        .overridingErrorMessage("Expected thumb offset <%s> but was <%s>.", offset, actualOffset) //
        .isEqualTo(offset);
    return myself;
  }
}