org.hamcrest.number
Class IsNaN

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<Double>
          extended by org.hamcrest.number.IsNaN
All Implemented Interfaces:
Matcher<Double>, SelfDescribing

public final class IsNaN
extends TypeSafeMatcher<Double>

Is the value a number actually not a number (NaN)?


Method Summary
 void describeMismatchSafely(Double item, Description mismatchDescription)
           
 void describeTo(Description description)
           
 boolean matchesSafely(Double item)
           
static Matcher<Double> notANumber()
          Creates a matcher of Doubles that matches when an examined double is not a number.
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

matchesSafely

public boolean matchesSafely(Double item)
Specified by:
matchesSafely in class TypeSafeMatcher<Double>

describeMismatchSafely

public void describeMismatchSafely(Double item,
                                   Description mismatchDescription)
Overrides:
describeMismatchSafely in class TypeSafeMatcher<Double>

describeTo

public void describeTo(Description description)

notANumber

public static Matcher<Double> notANumber()
Creates a matcher of Doubles that matches when an examined double is not a number.

For example:

assertThat(Double.NaN, is(notANumber()))



Copyright © 2014. All rights reserved.