org.fest.assertions.api.android.gesture.PredictionAssert 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.gesture;
import android.gesture.Prediction;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link Prediction} instances. */
public class PredictionAssert extends AbstractAssert {
public PredictionAssert(Prediction actual) {
super(actual, PredictionAssert.class);
}
public PredictionAssert hasName(String name) {
isNotNull();
String actualName = actual.name;
assertThat(actualName) //
.overridingErrorMessage("Expected name <%s> but was <%s>.", name, actualName) //
.isEqualTo(name);
return this;
}
public PredictionAssert hasScore(double score) {
isNotNull();
double actualScore = actual.score;
assertThat(actualScore) //
.overridingErrorMessage("Expected score <%s> but was <%s>.", score, actualScore) //
.isEqualTo(score);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy