org.assertj.android.api.util.PairAssert 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.
The newest version!
// Copyright 2013 Square, Inc.
package org.assertj.android.api.util;
import android.util.Pair;
import org.assertj.core.api.AbstractAssert;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link Pair} instances. */
public class PairAssert extends AbstractAssert, Pair> {
public PairAssert(Pair actual) {
super(actual, PairAssert.class);
}
public PairAssert hasFirst(F first) {
isNotNull();
F actualFirst = actual.first;
assertThat(actualFirst) //
.overridingErrorMessage("Expected first value <%s> but was <%s>.", first, actualFirst) //
.isEqualTo(first);
return this;
}
public PairAssert hasSecond(S second) {
isNotNull();
S actualSecond = actual.second;
assertThat(actualSecond) //
.overridingErrorMessage("Expected second value <%s> but was <%s>.", second, actualSecond) //
.isEqualTo(second);
return this;
}
}