org.fest.assertions.internal
Class Conditions

java.lang.Object
  extended by org.fest.assertions.internal.Conditions

public class Conditions
extends Object

Verifies that a value satisfies a Condition.

Author:
Alex Ruiz

Method Summary
<T> void
assertDoesNotHave(AssertionInfo info, T actual, Condition<T> condition)
          Asserts that the actual value does not satisfy the given Condition.
<T> void
assertHas(AssertionInfo info, T actual, Condition<T> condition)
          Asserts that the actual value satisfies the given Condition.
<T> void
assertIs(AssertionInfo info, T actual, Condition<T> condition)
          Asserts that the actual value satisfies the given Condition.
<T> void
assertIsNot(AssertionInfo info, T actual, Condition<T> condition)
          Asserts that the actual value does not satisfy the given Condition.
 void assertIsNotNull(Condition<?> condition)
          Asserts the the given Condition is not null.
static Conditions instance()
          Returns the singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static Conditions instance()
Returns the singleton instance of this class.

Returns:
the singleton instance of this class.

assertIs

public <T> void assertIs(AssertionInfo info,
                         T actual,
                         Condition<T> condition)
Asserts that the actual value satisfies the given Condition.

Type Parameters:
T - the type of the actual value and the type of values that given Condition takes.
Parameters:
info - contains information about the assertion.
actual - the actual value.
condition - the given Condition.
Throws:
NullPointerException - if the given Condition is null.
AssertionError - if the actual value does not satisfy the given Condition.

assertIsNot

public <T> void assertIsNot(AssertionInfo info,
                            T actual,
                            Condition<T> condition)
Asserts that the actual value does not satisfy the given Condition.

Type Parameters:
T - the type of the actual value and the type of values that given Condition takes.
Parameters:
info - contains information about the assertion.
actual - the actual value.
condition - the given Condition.
Throws:
NullPointerException - if the given Condition is null.
AssertionError - if the actual value satisfies the given Condition.

assertHas

public <T> void assertHas(AssertionInfo info,
                          T actual,
                          Condition<T> condition)
Asserts that the actual value satisfies the given Condition.

Type Parameters:
T - the type of the actual value and the type of values that given Condition takes.
Parameters:
info - contains information about the assertion.
actual - the actual value.
condition - the given Condition.
Throws:
NullPointerException - if the given Condition is null.
AssertionError - if the actual value does not satisfy the given Condition.

assertDoesNotHave

public <T> void assertDoesNotHave(AssertionInfo info,
                                  T actual,
                                  Condition<T> condition)
Asserts that the actual value does not satisfy the given Condition.

Type Parameters:
T - the type of the actual value and the type of values that given Condition takes.
Parameters:
info - contains information about the assertion.
actual - the actual value.
condition - the given Condition.
Throws:
NullPointerException - if the given Condition is null.
AssertionError - if the actual value satisfies the given Condition.

assertIsNotNull

public void assertIsNotNull(Condition<?> condition)
Asserts the the given Condition is not null.

Parameters:
condition - the given Condition.
Throws:
NullPointerException - if the given Condition is null.


Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.