org.fest.assertions
Class DoubleArrayAssert

java.lang.Object
  extended by org.fest.assertions.Assert
      extended by org.fest.assertions.GenericAssert<S,A>
          extended by org.fest.assertions.GroupAssert<S,A>
              extended by org.fest.assertions.ItemGroupAssert<S,A>
                  extended by org.fest.assertions.ArrayAssert<DoubleArrayAssert,double[]>
                      extended by org.fest.assertions.DoubleArrayAssert

public class DoubleArrayAssert
extends ArrayAssert<DoubleArrayAssert,double[]>

Assertions for double arrays.

To create a new instance of this class invoke Assertions.assertThat(double[]).

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.assertions.GenericAssert
actual, myself
 
Constructor Summary
protected DoubleArrayAssert(double... actual)
          Creates a new DoubleArrayAssert.
 
Method Summary
 DoubleArrayAssert contains(double... values)
          Verifies that the actual double array contains the given values.
 DoubleArrayAssert containsOnly(double... values)
          Verifies that the actual double array contains the given values only.
 DoubleArrayAssert excludes(double... values)
          Verifies that the actual double array does not contain the given values.
 DoubleArrayAssert isEqualTo(double[] expected)
          Verifies that the actual double array is equal to the given array.
 DoubleArrayAssert isEqualTo(double[] expected, Delta delta)
          Verifies that the actual double array is equal to the given array, within a positive delta.
 DoubleArrayAssert isNotEqualTo(double[] array)
          Verifies that the actual double array is not equal to the given array.
 
Methods inherited from class org.fest.assertions.ArrayAssert
actualAsList, actualAsSet, actualGroupSize
 
Methods inherited from class org.fest.assertions.ItemGroupAssert
assertContains, assertContainsOnly, assertDoesNotHaveDuplicates, assertExcludes, validateIsNotNull
 
Methods inherited from class org.fest.assertions.GroupAssert
hasSize, isEmpty, isNotEmpty, isNullOrEmpty
 
Methods inherited from class org.fest.assertions.GenericAssert
as, as, describedAs, describedAs, doesNotSatisfy, is, isIn, isIn, isNot, isNotIn, isNotIn, 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

DoubleArrayAssert

protected DoubleArrayAssert(double... actual)
Creates a new DoubleArrayAssert.

Parameters:
actual - the target to verify.
Method Detail

contains

public DoubleArrayAssert contains(double... values)
Verifies that the actual double array contains the given values.

Parameters:
values - the values to look for.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is null.
NullPointerException - if the given double array is null.
AssertionError - if the actual double array does not contain the given values.

containsOnly

public DoubleArrayAssert containsOnly(double... values)
Verifies that the actual double array contains the given values only.

Parameters:
values - the values to look for.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is null.
NullPointerException - if the given double array is null.
AssertionError - if the actual double array does not contain the given objects, or if the actual double array contains elements other than the ones specified.

excludes

public DoubleArrayAssert excludes(double... values)
Verifies that the actual double array does not contain the given values.

Parameters:
values - the values the array should exclude.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is null.
NullPointerException - if the given double array is null.
AssertionError - if the actual double array contains any of the given values.

isEqualTo

public DoubleArrayAssert isEqualTo(double[] expected)
Verifies that the actual double array is equal to the given array. Array equality is checked by Arrays.equals(double[], double[]).

Overrides:
isEqualTo in class GenericAssert<DoubleArrayAssert,double[]>
Parameters:
expected - the given array to compare the actual array to.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is not equal to the given one.

isEqualTo

public DoubleArrayAssert isEqualTo(double[] expected,
                                   Delta delta)
Verifies that the actual double array is equal to the given array, within a positive delta.

Parameters:
expected - the given array to compare the actual array to.
delta - the given delta.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is not equal to the given one.
Since:
1.1

isNotEqualTo

public DoubleArrayAssert isNotEqualTo(double[] array)
Verifies that the actual double array is not equal to the given array. Array equality is checked by Arrays.equals(double[], double[]).

Overrides:
isNotEqualTo in class GenericAssert<DoubleArrayAssert,double[]>
Parameters:
array - the given array to compare the actual array to.
Returns:
this assertion object.
Throws:
AssertionError - if the actual double array is equal to the given one.


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