org.assertj.android.api.widget.AbstractAbsSeekBarAssert 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.widget;
import android.annotation.TargetApi;
import android.graphics.drawable.Drawable;
import android.widget.AbsSeekBar;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
import static org.assertj.core.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;
}
@TargetApi(JELLY_BEAN)
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;
}
}