org.assertj.android.api.app.TaskStackBuilderAssert 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.
package org.assertj.android.api.app;
import android.annotation.TargetApi;
import android.app.TaskStackBuilder;
import android.content.Intent;
import org.assertj.core.api.AbstractAssert;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link TaskStackBuilder} instances. */
@TargetApi(JELLY_BEAN)
public class TaskStackBuilderAssert extends AbstractAssert {
public TaskStackBuilderAssert(TaskStackBuilder actual) {
super(actual, TaskStackBuilderAssert.class);
}
public TaskStackBuilderAssert hasIntentCount(int count) {
isNotNull();
int actualCount = actual.getIntentCount();
assertThat(actualCount) //
.overridingErrorMessage("Expected intent count <%s> but was <%s>.", count, actualCount) //
.isEqualTo(count);
return this;
}
public TaskStackBuilderAssert containsIntents(Intent... intents) {
isNotNull();
assertThat(actual.getIntents()).contains(intents);
return this;
}
}