Itenso.TimePeriod.TimeRange.Equals C# (CSharp) Method

Equals() public final method

public final Equals ( object obj ) : bool
obj object
return bool
        public override sealed bool Equals( object obj )
        {
            if ( obj == this )
            {
                return true;
            }
            if ( obj == null || GetType() != obj.GetType() )
            {
                return false;
            }
            return IsEqual( obj );
        }

Usage Example

Example #1
0
        public void EqualsTest()
        {
            TimeRange timeRange1 = new TimeRange( start, end );

            TimeRange timeRange2 = new TimeRange( start, end );
            Assert.IsTrue( timeRange1.Equals( timeRange2 ) );

            TimeRange timeRange3 = new TimeRange( start.AddMilliseconds( -1 ), end.AddMilliseconds( 1 ) );
            Assert.IsFalse( timeRange1.Equals( timeRange3 ) );
        }