com.google.common.truth
Class PrimitiveFloatArraySubject

java.lang.Object
  extended by com.google.common.truth.Subject<AbstractArraySubject<S,T>,T>
      extended by com.google.common.truth.AbstractArraySubject<PrimitiveFloatArraySubject,float[]>
          extended by com.google.common.truth.PrimitiveFloatArraySubject

public class PrimitiveFloatArraySubject
extends AbstractArraySubject<PrimitiveFloatArraySubject,float[]>

A Subject to handle testing propositions for float[]. Note: this class deprecates some common methods because the operation of equality and comparison on floating point numbers requires additional specification. Alternatives equality tests are provided.

Author:
Christian Gruber ([email protected])

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
 
Field Summary
 
Fields inherited from class com.google.common.truth.Subject
failureStrategy
 
Constructor Summary
PrimitiveFloatArraySubject(FailureStrategy failureStrategy, float[] o)
           
 
Method Summary
 void isEqualTo(Object expected)
          Deprecated. use #isEqualTo(Object, double)
 void isEqualTo(Object expected, float tolerance)
          A proposition that the provided float[] is an array of the same length and type, and contains elements such that each element in expected is equal to each element in the subject, and in the same position.
 void isNotEqualTo(Object expected)
          Deprecated. use #isNotEqualTo(Object, double)
 void isNotEqualTo(Object expectedArray, float tolerance)
           
protected  List<Float> listRepresentation()
           
protected  String underlyingType()
           
 
Methods inherited from class com.google.common.truth.AbstractArraySubject
failWithBadType, getDisplaySubject, named
 
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getSubject, hasField, hashCode, internalCustomName, is, isA, isNotA, isNotNull, isNull, labeled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimitiveFloatArraySubject

public PrimitiveFloatArraySubject(FailureStrategy failureStrategy,
                                  float[] o)
Method Detail

underlyingType

protected String underlyingType()
Specified by:
underlyingType in class AbstractArraySubject<PrimitiveFloatArraySubject,float[]>

listRepresentation

protected List<Float> listRepresentation()
Specified by:
listRepresentation in class AbstractArraySubject<PrimitiveFloatArraySubject,float[]>

isEqualTo

@Deprecated
public void isEqualTo(Object expected)
Deprecated. use #isEqualTo(Object, double)

This form is unsafe for floating point types, and will throw an UnsupportedOperationException.

Overrides:
isEqualTo in class Subject<AbstractArraySubject<PrimitiveFloatArraySubject,float[]>,float[]>

isEqualTo

public void isEqualTo(Object expected,
                      float tolerance)
A proposition that the provided float[] is an array of the same length and type, and contains elements such that each element in expected is equal to each element in the subject, and in the same position.


isNotEqualTo

@Deprecated
public void isNotEqualTo(Object expected)
Deprecated. use #isNotEqualTo(Object, double)

This form is unsafe for floating point types, and will throw an UnsupportedOperationException.

Overrides:
isNotEqualTo in class Subject<AbstractArraySubject<PrimitiveFloatArraySubject,float[]>,float[]>

isNotEqualTo

public void isNotEqualTo(Object expectedArray,
                         float tolerance)


Copyright © 2014. All rights reserved.