C# Class NFluent.Extensions.ExtensionsCommonHelpers

Common helper methods for the NFluent extension methods.
显示文件 Open project: tpierrain/NFluent

Public Methods

Method Description
DoubleCurlyBraces ( this value ) : string

Doubles the curly braces in the string.

GetBaseType ( this type ) : Type

Gets the base type of the given type

Simplify port to .Net Core

ImplementsEquals ( this type ) : bool

Determines whether the specified type implements Equals.

IsNullable ( this type ) : bool

Determines whether the specified type is nullable.

IsNumerical ( Type type ) : bool

Checks if a type is numerical (i.e: int, double, short, uint...)

ToStringProperlyFormated ( this theObject ) : string

Returns a string that represents the current object. If the object is already a string, this method will surround it with brackets.

TypeToStringProperlyFormated ( this type, bool shortName = false ) : string

Returns a string with the type name, as seen in source code.

Private Methods

Method Description
TruncateLongString ( string result ) : string

Method Details

DoubleCurlyBraces() public static method

Doubles the curly braces in the string.
public static DoubleCurlyBraces ( this value ) : string
value this String to correct.
return string

GetBaseType() public static method

Gets the base type of the given type
Simplify port to .Net Core
public static GetBaseType ( this type ) : Type
type this Type
return System.Type

ImplementsEquals() public static method

Determines whether the specified type implements Equals.
public static ImplementsEquals ( this type ) : bool
type this The type to be analyzed.
return bool

IsNullable() public static method

Determines whether the specified type is nullable.
public static IsNullable ( this type ) : bool
type this /// The type to be evaluated. ///
return bool

IsNumerical() public static method

Checks if a type is numerical (i.e: int, double, short, uint...)
public static IsNumerical ( Type type ) : bool
type System.Type
return bool

ToStringProperlyFormated() public static method

Returns a string that represents the current object. If the object is already a string, this method will surround it with brackets.
public static ToStringProperlyFormated ( this theObject ) : string
theObject this The theObject.
return string

TypeToStringProperlyFormated() public static method

Returns a string with the type name, as seen in source code.
public static TypeToStringProperlyFormated ( this type, bool shortName = false ) : string
type this /// The type to get the name of. ///
shortName bool /// If set to true return the name without namespaces. ///
return string