org.assertj.android.api.accounts.AccountAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
// Copyright 2013 Square, Inc.
package org.assertj.android.api.accounts;
import android.accounts.Account;
import org.assertj.core.api.AbstractAssert;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link Account} instances. */
public class AccountAssert extends AbstractAssert {
public AccountAssert(Account actual) {
super(actual, AccountAssert.class);
}
public AccountAssert hasName(String name) {
isNotNull();
String actualName = actual.name;
assertThat(actualName) //
.overridingErrorMessage("Expected name <%s> but was <%s>.", name, actualName) //
.isEqualTo(name);
return this;
}
public AccountAssert hasType(String type) {
isNotNull();
String actualType = actual.type;
assertThat(actualType) //
.overridingErrorMessage("Expected type <%s> but was <%s>.", type, actualType) //
.isEqualTo(type);
return this;
}
}