C# Class NFluent.Helpers.Duration

Represents a duration as an unit and a quantity.
Exibir arquivo Open project: tpierrain/NFluent Class Usage Examples

Public Methods

Method Description
ConvertTo ( TimeUnit newTmeUnit ) : Duration

Gets a new instance for the same duration expressed in another TimeUnit

ConvertToMilliseconds ( double duration, TimeUnit durationTimeUnit ) : int

Converts a given duration to a number of milliseconds.

Duration ( System.TimeSpan timeSpan, TimeUnit unit ) : System

Initializes a new instance of the Duration struct.

Duration ( double rawDuration, TimeUnit timeUnit ) : System

Initializes a new instance of the Duration struct.

Equals ( Duration other ) : bool

Checks if the duration is equal to another one.

Equals ( object obj ) : bool

Checks if the duration is equal to another object.

GetHashCode ( ) : int

Gets the hash value of this instance.

ToString ( ) : string

Returns a System.String that represents this instance.

operator ( ) : bool

Checks if duration a is less than duration b.

Method Details

ConvertTo() public method

Gets a new instance for the same duration expressed in another TimeUnit
public ConvertTo ( TimeUnit newTmeUnit ) : Duration
newTmeUnit TimeUnit The target time unit.
return Duration

ConvertToMilliseconds() public static method

Converts a given duration to a number of milliseconds.
public static ConvertToMilliseconds ( double duration, TimeUnit durationTimeUnit ) : int
duration double The duration value.
durationTimeUnit TimeUnit The time unit of the duration.
return int

Duration() public method

Initializes a new instance of the Duration struct.
public Duration ( System.TimeSpan timeSpan, TimeUnit unit ) : System
timeSpan System.TimeSpan The time span.
unit TimeUnit The time unit.
return System

Duration() public method

Initializes a new instance of the Duration struct.
public Duration ( double rawDuration, TimeUnit timeUnit ) : System
rawDuration double /// Duration of the raw. ///
timeUnit TimeUnit /// The time unit. ///
return System

Equals() public method

Checks if the duration is equal to another one.
public Equals ( Duration other ) : bool
other Duration The duration to compare to.
return bool

Equals() public method

Checks if the duration is equal to another object.
public Equals ( object obj ) : bool
obj object The duration to compare to.
return bool

GetHashCode() public method

Gets the hash value of this instance.
public GetHashCode ( ) : int
return int

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : string
return string

operator() public static method

Checks if duration a is less than duration b.
public static operator ( ) : bool
return bool