com.google.common.truth
Class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>

java.lang.Object
  extended by com.google.common.truth.Subject<S,M>
      extended by com.google.common.truth.MapSubject<S,K,V,M>

public class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>
extends Subject<S,M>

Author:
Christian Gruber ([email protected])

Nested Class Summary
static interface MapSubject.WithValue<V>
           
 
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
 
Field Summary
 
Fields inherited from class com.google.common.truth.Subject
failureStrategy
 
Constructor Summary
MapSubject(FailureStrategy failureStrategy, M map)
           
 
Method Summary
static
<K,V,M extends Map<K,V>>
MapSubject<? extends MapSubject<?,K,V,M>,K,V,M>
create(FailureStrategy failureStrategy, Map<K,V> map)
           
 MapSubject.WithValue<V> hasKey(K key)
          Attests that the subject contains the provided key or fails.
 void hasValue(V key)
           
 void isEmpty()
          Attests that the subject holds no objects, or fails.
 void isNotEmpty()
          Attests that the subject holds one or more objects, or fails
 void lacksKey(K key)
           
 void lacksValue(V key)
           
 
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isNotA, isNotEqualTo, isNotNull, isNull, labeled, named
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapSubject

public MapSubject(FailureStrategy failureStrategy,
                  M map)
Method Detail

isEmpty

public void isEmpty()
Attests that the subject holds no objects, or fails.


isNotEmpty

public void isNotEmpty()
Attests that the subject holds one or more objects, or fails


hasKey

public MapSubject.WithValue<V> hasKey(K key)
Attests that the subject contains the provided key or fails.


lacksKey

public void lacksKey(K key)

hasValue

public void hasValue(V key)

lacksValue

public void lacksValue(V key)

create

public static <K,V,M extends Map<K,V>> MapSubject<? extends MapSubject<?,K,V,M>,K,V,M> create(FailureStrategy failureStrategy,
                                                                                              Map<K,V> map)


Copyright © 2014. All rights reserved.