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 NullPointerException if the expected number is {@code null}. 035 * @throws AssertionError if the actual value is not equal to the given one. 036 */ 037 FloatingPointNumberAssert<T> isEqualTo(T expected, Offset<T> offset); 038 039 /** 040 * Verifies that the actual value is equal to {@code NaN}. 041 * @return this assertion object. 042 * @throws AssertionError if the actual value is not equal to {@code NaN}. 043 */ 044 FloatingPointNumberAssert<T> isNaN(); 045 046 /** 047 * Verifies that the actual value is not equal to {@code NaN}. 048 * @return this assertion object. 049 * @throws AssertionError if the actual value is equal to {@code NaN}. 050 */ 051 FloatingPointNumberAssert<T> isNotNaN(); 052 }