All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fest.assertions.api.android.gesture.PredictionAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
// 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