org.fest.assertions.api.android.util.PairAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fest-android Show documentation
Show all versions of fest-android Show documentation
A set of FEST assertion helpers geared toward testing Android.
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.util;
import android.util.Pair;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.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;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy