
org.fest.assertions.api.android.content.ContentValuesAssert 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.
The newest version!
package org.fest.assertions.api.android.content;
import android.content.ContentValues;
import org.fest.assertions.api.AbstractAssert;
import org.fest.assertions.core.WritableAssertionInfo;
import org.fest.assertions.internal.Failures;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.error.ShouldContain.shouldContain;
import static org.fest.util.Objects.areEqual;
/** Assertions for {@link ContentValues} instances. */
public class ContentValuesAssert extends AbstractAssert {
public ContentValuesAssert(ContentValues actual) {
super(actual, ContentValuesAssert.class);
}
public ContentValuesAssert isEmpty() {
isNotNull();
assertThat(actual.size())
.overridingErrorMessage("Expected to be empty but was not.")
.isZero();
return this;
}
public ContentValuesAssert isNotEmpty() {
isNotNull();
assertThat(actual.size())
.overridingErrorMessage("Expected to not be empty but was.")
.isNotZero();
return this;
}
public ContentValuesAssert containsKey(String key) {
isNotNull();
assertThat(actual.containsKey(key))
.overridingErrorMessage("Expected key <%s> but was not found.", key)
.isTrue();
return this;
}
public ContentValuesAssert containsValue(Object expectedValue) {
isNotNull();
Set> entries = actual.valueSet();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy