org.fest.assertions.api.android.gesture.GestureStrokeAssert 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.GestureStroke;
import android.graphics.RectF;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link GestureStroke} instances. */
public class GestureStrokeAssert extends AbstractAssert {
public GestureStrokeAssert(GestureStroke actual) {
super(actual, GestureStrokeAssert.class);
}
public GestureStrokeAssert hasBoundingBox(RectF rect) {
isNotNull();
RectF actualRect = actual.boundingBox;
assertThat(actualRect) //
.overridingErrorMessage("Expected bounding box <%s> but was <%s>.", rect, actualRect) //
.isEqualTo(rect);
return this;
}
public GestureStrokeAssert hasLength(float length) {
isNotNull();
float actualLength = actual.length;
assertThat(actualLength) //
.overridingErrorMessage("Expected length <%s> but was <%s>.", length, actualLength) //
.isEqualTo(length);
return this;
}
public GestureStrokeAssert hasPoints(float[] points) {
isNotNull();
float[] actualPoints = actual.points;
assertThat(actualPoints) //
.overridingErrorMessage("Expected points <%s> but was <%s>.", points, actualPoints) //
.isEqualTo(points);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy