com.google.common.truth
Class TruthJUnit

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

public class TruthJUnit
extends Object

Truth - a proposition framework for tests, supporting JUnit style assertion and assumption semantics in a fluent style. TruthJUnit contains a junit-specific "failure strategy" known as an assumption. An assumption is a proposition that, if the proposition is false, aborts (skips) the test. This is especially useful in JUnit theories or parameterized tests, or other combinatorial tests where some subset of the combinations are simply not applicable for testing. TruthJUnit is the entry point for assumptions, via the assume() method. eg:

import com.google.common.truth.Truth.assert_;
 import com.google.common.truth.Truth.assume;

 public void @Test testFoosAgainstBars {
   assume().that(foo).isNotNull();
   assume().that(bar).isNotNull();
   assert_().that(foo.times(bar)).isEqualTo(blah);
 }
 

Author:
David Saff, Christian Gruber ([email protected])

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

Field Detail

THROW_ASSUMPTION_ERROR

@GwtIncompatible(value="JUnit4")
public static final FailureStrategy THROW_ASSUMPTION_ERROR
Constructor Detail

TruthJUnit

public TruthJUnit()
Method Detail

assume

@GwtIncompatible(value="JUnit4")
public static final TestVerb assume()


Copyright © 2014. All rights reserved.