@CheckReturnValue public class TestVerb extends AbstractVerb<TestVerb>
AbstractVerb.DelegatedVerb<S extends Subject<S,T>,T>, AbstractVerb.MessagePrependingFailureStrategy
Constructor and Description |
---|
TestVerb(FailureStrategy failureStrategy) |
TestVerb(FailureStrategy failureStrategy,
String format) |
TestVerb(FailureStrategy failureStrategy,
String format,
Object... args) |
Modifier and Type | Method and Description |
---|---|
String |
getFailureMessage() |
protected boolean |
hasFailureMessage() |
BigDecimalSubject |
that(BigDecimal target) |
BooleanSubject |
that(Boolean target) |
PrimitiveBooleanArraySubject |
that(boolean[] target) |
PrimitiveByteArraySubject |
that(byte[] target) |
PrimitiveCharArraySubject |
that(char[] target) |
ClassSubject |
that(Class<?> target) |
DoubleSubject |
that(Double target) |
PrimitiveDoubleArraySubject |
that(double[] target) |
FloatSubject |
that(Float target) |
PrimitiveFloatArraySubject |
that(float[] target) |
PrimitiveIntArraySubject |
that(int[] target) |
IntegerSubject |
that(Integer target) |
<T,C extends Iterable<T>> |
that(Iterable<T> target) |
<K,V,M extends com.google.common.collect.ListMultimap<K,V>> |
that(com.google.common.collect.ListMultimap<K,V> target) |
LongSubject |
that(Long target) |
PrimitiveLongArraySubject |
that(long[] target) |
MapSubject |
that(Map<?,?> target) |
<K,V,M extends com.google.common.collect.Multimap<K,V>> |
that(com.google.common.collect.Multimap<K,V> target) |
<E,M extends com.google.common.collect.Multiset<E>> |
that(com.google.common.collect.Multiset<E> target) |
Subject<DefaultSubject,Object> |
that(Object target) |
GuavaOptionalSubject |
that(com.google.common.base.Optional<?> target) |
<K,V,M extends com.google.common.collect.SetMultimap<K,V>> |
that(com.google.common.collect.SetMultimap<K,V> target) |
PrimitiveShortArraySubject |
that(short[] target) |
StringSubject |
that(String target) |
<T extends Comparable<?>> |
that(T target) |
<T> ObjectArraySubject<T> |
that(T[] target) |
TableSubject |
that(com.google.common.collect.Table<?,?,?> target) |
ThrowableSubject |
that(Throwable target) |
TestVerb |
withFailureMessage(String failureMessage)
Overrides the failure message of the subsequent subject's propositions.
|
TestVerb |
withFailureMessage(String format,
Object... args)
Returns a
TestVerb that will prepend the formatted message using the specified
arguments to the failure message in the event of a test failure. |
about, fail, fail, getFailureStrategy
public TestVerb(FailureStrategy failureStrategy)
public TestVerb(FailureStrategy failureStrategy, @Nullable String format)
public TestVerb(FailureStrategy failureStrategy, @Nullable String format, @Nullable Object... args)
public <T extends Comparable<?>> ComparableSubject<?,T> that(@Nullable T target)
public BigDecimalSubject that(@Nullable BigDecimal target)
public Subject<DefaultSubject,Object> that(@Nullable Object target)
@GwtIncompatible(value="ClassSubject.java") public ClassSubject that(@Nullable Class<?> target)
public ThrowableSubject that(@Nullable Throwable target)
public LongSubject that(@Nullable Long target)
public DoubleSubject that(@Nullable Double target)
public FloatSubject that(@Nullable Float target)
public IntegerSubject that(@Nullable Integer target)
public BooleanSubject that(@Nullable Boolean target)
public StringSubject that(@Nullable String target)
public <T,C extends Iterable<T>> IterableSubject<? extends IterableSubject<?,T,C>,T,C> that(@Nullable Iterable<T> target)
public <T> ObjectArraySubject<T> that(@Nullable T[] target)
public PrimitiveBooleanArraySubject that(@Nullable boolean[] target)
public PrimitiveShortArraySubject that(@Nullable short[] target)
public PrimitiveIntArraySubject that(@Nullable int[] target)
public PrimitiveLongArraySubject that(@Nullable long[] target)
public PrimitiveCharArraySubject that(@Nullable char[] target)
public PrimitiveByteArraySubject that(@Nullable byte[] target)
public PrimitiveFloatArraySubject that(@Nullable float[] target)
public PrimitiveDoubleArraySubject that(@Nullable double[] target)
public GuavaOptionalSubject that(@Nullable com.google.common.base.Optional<?> target)
public MapSubject that(@Nullable Map<?,?> target)
public <K,V,M extends com.google.common.collect.Multimap<K,V>> MultimapSubject<? extends MultimapSubject<?,K,V,M>,K,V,M> that(@Nullable com.google.common.collect.Multimap<K,V> target)
public <K,V,M extends com.google.common.collect.ListMultimap<K,V>> ListMultimapSubject<? extends ListMultimapSubject<?,K,V,M>,K,V,M> that(@Nullable com.google.common.collect.ListMultimap<K,V> target)
public <K,V,M extends com.google.common.collect.SetMultimap<K,V>> SetMultimapSubject<? extends SetMultimapSubject<?,K,V,M>,K,V,M> that(@Nullable com.google.common.collect.SetMultimap<K,V> target)
public <E,M extends com.google.common.collect.Multiset<E>> MultisetSubject<? extends MultisetSubject<?,E,M>,E,M> that(@Nullable com.google.common.collect.Multiset<E> target)
public TableSubject that(@Nullable com.google.common.collect.Table<?,?,?> target)
public TestVerb withFailureMessage(@Nullable String failureMessage)
AbstractVerb
withFailureMessage
in class AbstractVerb<TestVerb>
failureMessage
- a descriptive message. null
to remove any current message.com.google.common.truth.delegation.DelegationTest
public TestVerb withFailureMessage(String format, Object... args)
TestVerb
that will prepend the formatted message using the specified
arguments to the failure message in the event of a test failure.
Note: The failure message template string only supports the "%s"
specifier,
not the full range of Formatter
specifiers.
IllegalArgumentException
- if the number of placeholders in the format string does not
equal the number of given arguments@Nullable public String getFailureMessage()
getFailureMessage
in class AbstractVerb<TestVerb>
protected boolean hasFailureMessage()
hasFailureMessage
in class AbstractVerb<TestVerb>
Copyright © 2015. All Rights Reserved.