001    /*
002     * Created on Oct 23, 2010
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
005     * the License. You may obtain a copy of the License at
006     *
007     * http://www.apache.org/licenses/LICENSE-2.0
008     *
009     * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
010     * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
011     * specific language governing permissions and limitations under the License.
012     *
013     * Copyright @2010-2011 the original author or authors.
014     */
015    package org.fest.assertions.core;
016    
017    import org.fest.assertions.data.Offset;
018    
019    /**
020     * Assertion methods applicable to floating-point <code>{@link Number}</code>s.
021     * @param <T> the type of the "actual" value.
022     *
023     * @author Alex Ruiz
024     * @author Yvonne Wang
025     */
026    public interface FloatingPointNumberAssert<T extends Number> extends NumberAssert<T> {
027    
028      /**
029       * Verifies that the actual value is equal to the given one, within a positive offset.
030       * @param expected the given value to compare the actual value to.
031       * @param offset the given positive offset.
032       * @return {@code this} assertion object.
033       * @throws NullPointerException if the given offset is {@code null}.
034       * @throws AssertionError if the actual value is not equal to the given one.
035       */
036      FloatingPointNumberAssert<T> isEqualTo(T expected, Offset<T> offset);
037    
038      /**
039       * Verifies that the actual value is equal to {@code NaN}.
040       * @return this assertion object.
041       * @throws AssertionError if the actual value is not equal to {@code NaN}.
042       */
043      FloatingPointNumberAssert<T> isNaN();
044    
045      /**
046       * Verifies that the actual value is not equal to {@code NaN}.
047       * @return this assertion object.
048       * @throws AssertionError if the actual value is equal to {@code NaN}.
049       */
050      FloatingPointNumberAssert<T> isNotNaN();
051    }