C# Класс NUnit.Framework.Constraints.Numerics

The Numerics class contains common operations on numeric values.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AreEqual ( object expected, object actual, NUnit.Framework.Constraints.Tolerance &tolerance ) : bool

Test two numeric values for equality, performing the usual numeric conversions and using a provided or default tolerance. If the tolerance provided is Empty, this method may set it to a default tolerance.

Compare ( object expected, object actual ) : int

Compare two numeric values, performing the usual numeric conversions.

IsFixedPointNumeric ( Object obj ) : bool

Checks the type of the object, returning true if the object is a fixed point numeric type.

IsFloatingPointNumeric ( Object obj ) : bool

Checks the type of the object, returning true if the object is a floating point numeric type.

IsNumericType ( Object obj ) : bool

Checks the type of the object, returning true if the object is a numeric type.

Приватные методы

Метод Описание
AreEqual ( decimal expected, decimal actual, NUnit.Framework.Constraints.Tolerance tolerance ) : bool
AreEqual ( double expected, double actual, NUnit.Framework.Constraints.Tolerance &tolerance ) : bool
AreEqual ( float expected, float actual, NUnit.Framework.Constraints.Tolerance &tolerance ) : bool
AreEqual ( int expected, int actual, NUnit.Framework.Constraints.Tolerance tolerance ) : bool
AreEqual ( long expected, long actual, NUnit.Framework.Constraints.Tolerance tolerance ) : bool
AreEqual ( uint expected, uint actual, NUnit.Framework.Constraints.Tolerance tolerance ) : bool
AreEqual ( ulong expected, ulong actual, NUnit.Framework.Constraints.Tolerance tolerance ) : bool
Numerics ( ) : System

Описание методов

AreEqual() публичный статический Метод

Test two numeric values for equality, performing the usual numeric conversions and using a provided or default tolerance. If the tolerance provided is Empty, this method may set it to a default tolerance.
public static AreEqual ( object expected, object actual, NUnit.Framework.Constraints.Tolerance &tolerance ) : bool
expected object The expected value
actual object The actual value
tolerance NUnit.Framework.Constraints.Tolerance A reference to the tolerance in effect
Результат bool

Compare() публичный статический Метод

Compare two numeric values, performing the usual numeric conversions.
public static Compare ( object expected, object actual ) : int
expected object The expected value
actual object The actual value
Результат int

IsFixedPointNumeric() публичный статический Метод

Checks the type of the object, returning true if the object is a fixed point numeric type.
public static IsFixedPointNumeric ( Object obj ) : bool
obj Object The object to check
Результат bool

IsFloatingPointNumeric() публичный статический Метод

Checks the type of the object, returning true if the object is a floating point numeric type.
public static IsFloatingPointNumeric ( Object obj ) : bool
obj Object The object to check
Результат bool

IsNumericType() публичный статический Метод

Checks the type of the object, returning true if the object is a numeric type.
public static IsNumericType ( Object obj ) : bool
obj Object The object to check
Результат bool