com.google.common.truth
Class Truth

java.lang.Object
  extended by com.google.common.truth.Truth

public class Truth
extends Object

Truth - a proposition framework for tests, supporting JUnit style assertion and assumption semantics in a fluent style. Truth is the simplest entry point class. A developer can statically import the assert_() method to get easy access to the library's capabilities. Then, instead of writing:

Assert.assertEquals(a,b);
 Assert.assertTrue(c);
 Assert.assertTrue(d.contains(a) && d.contains(e));
 Assert.assertTrue(d.contains(a) || d.contains(q) || d.contains(z));
 
one would write:
assert_().that(aString).equals(bString);
 assert_().that(aBoolean).isTrue();
 assert_().that(collection).has().item(aString);
 assert_().that(collection).containsAllOf(aString, bString);
 assert_().that(collection).containsAnyOf(aString, qString, zString);
 
Tests should be easier to read, and flow more clearly.

Author:
David Saff, Christian Gruber (cgruber@israfil.net)

Field Summary
static FailureStrategy THROW_ASSERTION_ERROR
           
 
Constructor Summary
Truth()
           
 
Method Summary
static TestVerb assert_()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THROW_ASSERTION_ERROR

public static final FailureStrategy THROW_ASSERTION_ERROR
Constructor Detail

Truth

public Truth()
Method Detail

assert_

public static TestVerb assert_()


Copyright © 2014. All rights reserved.