Package com.google.common.truth
Class PrimitiveDoubleArraySubject
- java.lang.Object
-
- com.google.common.truth.Subject<AbstractArraySubject<S,T>,T>
-
- com.google.common.truth.AbstractArraySubject<PrimitiveDoubleArraySubject,double[]>
-
- com.google.common.truth.PrimitiveDoubleArraySubject
-
public class PrimitiveDoubleArraySubject extends AbstractArraySubject<PrimitiveDoubleArraySubject,double[]>
A Subject to handle testing propositions fordouble[]
. 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.
-
-
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
Constructors Constructor Description PrimitiveDoubleArraySubject(FailureStrategy failureStrategy, double[] o)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private ListSubject<?,java.lang.Double,java.util.List<java.lang.Double>>
asList()
void
isEqualTo(java.lang.Object expected)
Deprecated.void
isEqualTo(java.lang.Object expected, double tolerance)
A proposition that the provided double[] is an array of the same length and type, and contains elements such that each element inexpected
is equal to each element in the subject, and in the same position.void
isNotEqualTo(java.lang.Object expected)
Deprecated.void
isNotEqualTo(java.lang.Object expectedArray, double tolerance)
A proposition that the provided double[] is not an array of the same length or type, or has at least one element that does not pass an equality test within the given tolerance.protected java.util.List<java.lang.Double>
listRepresentation()
protected java.lang.String
underlyingType()
-
Methods inherited from class com.google.common.truth.AbstractArraySubject
failWithBadType, getDisplaySubject, hasLength, isEmpty, isNotEmpty, named
-
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getSubject, hasField, hashCode, internalCustomName, is, isA, isInstanceOf, isNotA, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled
-
-
-
-
Constructor Detail
-
PrimitiveDoubleArraySubject
PrimitiveDoubleArraySubject(FailureStrategy failureStrategy, double[] o)
-
-
Method Detail
-
underlyingType
protected java.lang.String underlyingType()
- Specified by:
underlyingType
in classAbstractArraySubject<PrimitiveDoubleArraySubject,double[]>
-
listRepresentation
protected java.util.List<java.lang.Double> listRepresentation()
- Specified by:
listRepresentation
in classAbstractArraySubject<PrimitiveDoubleArraySubject,double[]>
-
isEqualTo
@Deprecated public void isEqualTo(java.lang.Object expected)
Deprecated.This form is unsafe for double-precision floating point types, and will throw anUnsupportedOperationException
.- Overrides:
isEqualTo
in classSubject<AbstractArraySubject<PrimitiveDoubleArraySubject,double[]>,double[]>
-
isEqualTo
public void isEqualTo(java.lang.Object expected, double tolerance)
A proposition that the provided double[] is an array of the same length and type, and contains elements such that each element inexpected
is equal to each element in the subject, and in the same position.
-
isNotEqualTo
@Deprecated public void isNotEqualTo(java.lang.Object expected)
Deprecated.This form is unsafe for double-precision floating point types, and will throw anUnsupportedOperationException
.- Overrides:
isNotEqualTo
in classSubject<AbstractArraySubject<PrimitiveDoubleArraySubject,double[]>,double[]>
-
isNotEqualTo
public void isNotEqualTo(java.lang.Object expectedArray, double tolerance)
A proposition that the provided double[] is not an array of the same length or type, or has at least one element that does not pass an equality test within the given tolerance.
-
asList
private ListSubject<?,java.lang.Double,java.util.List<java.lang.Double>> asList()
-
-