org.fest.assertions.api.android.graphics.PathAssert 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.graphics;
import android.graphics.Path;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link Path} instances. */
public class PathAssert extends AbstractAssert {
public PathAssert(Path actual) {
super(actual, PaintAssert.class);
}
public PathAssert hasFillType(Path.FillType type) {
isNotNull();
Path.FillType actualType = actual.getFillType();
assertThat(actualType) //
.overridingErrorMessage("Expected fill type <%s> but was <%s>.", type, actualType) //
.isEqualTo(type);
return this;
}
public PathAssert isEmpty() {
isNotNull();
assertThat(actual.isEmpty()) //
.overridingErrorMessage("Expected to be empty but was not.") //
.isTrue();
return this;
}
public PathAssert isNotEmpty() {
isNotNull();
assertThat(actual.isEmpty()) //
.overridingErrorMessage("Expected to not be empty but was.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy