org.fest.assertions
Class GroupAssert<T>

java.lang.Object
  extended by org.fest.assertions.Assert
      extended by org.fest.assertions.GenericAssert<T>
          extended by org.fest.assertions.GroupAssert<T>
Type Parameters:
T - the type of object implementations of this template can verify.
Direct Known Subclasses:
ArrayAssert, CollectionAssert, ListAssert, MapAssert, StringAssert

public abstract class GroupAssert<T>
extends GenericAssert<T>

Understands a template for assertion methods related to arrays or collections.

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.assertions.GenericAssert
actual
 
Constructor Summary
protected GroupAssert(T actual)
          Creates a new GroupAssert.
 
Method Summary
protected abstract  int actualGroupSize()
          Returns the size of the actual group (array, collection, etc.)
protected abstract  GroupAssert<T> hasSize(int expected)
          Verifies that the number of values in the actual group is equal to the given one.
protected abstract  void isEmpty()
          Verifies that the actual group is empty.
protected abstract  GroupAssert<T> isNotEmpty()
          Verifies that the actual group contains at least on value.
protected abstract  void isNullOrEmpty()
          Verifies that the actual group is null or empty.
 
Methods inherited from class org.fest.assertions.GenericAssert
as, as, assertDoesNotSatisfy, assertEqualTo, assertIs, assertIsNot, assertNotEqualTo, assertNotNull, assertNotSameAs, assertSameAs, assertSatisfies, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isNot, isNotEqualTo, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfies
 
Methods inherited from class org.fest.assertions.Assert
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupAssert

protected GroupAssert(T actual)
Creates a new GroupAssert.

Parameters:
actual - the target to verify.
Method Detail

isNullOrEmpty

protected abstract void isNullOrEmpty()
Verifies that the actual group is null or empty.

Throws:
AssertionError - if the actual group is not null or not empty.

isEmpty

protected abstract void isEmpty()
Verifies that the actual group is empty.

Throws:
AssertionError - if the actual group is null or not empty.

isNotEmpty

protected abstract GroupAssert<T> isNotEmpty()
Verifies that the actual group contains at least on value.

Returns:
this assertion object.
Throws:
AssertionError - if the actual group is null or empty.

hasSize

protected abstract GroupAssert<T> hasSize(int expected)
Verifies that the number of values in the actual group is equal to the given one.

Parameters:
expected - the expected number of values in the actual group.
Returns:
this assertion object.
Throws:
AssertionError - if the number of values of the actual group is not equal to the given one.

actualGroupSize

protected abstract int actualGroupSize()
Returns the size of the actual group (array, collection, etc.)

Returns:
the size of the actual group.


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