Move() public method

public Move ( System.TimeSpan offset ) : void
offset System.TimeSpan
return void
        public void MoveTest()
        {
            TimeInterval timeIntervalMoveZero = new TimeInterval( start, end );
            timeIntervalMoveZero.Move( TimeSpan.Zero );
            Assert.AreEqual( timeIntervalMoveZero.Start, start );
            Assert.AreEqual( timeIntervalMoveZero.End, end );
            Assert.AreEqual( timeIntervalMoveZero.Duration, duration );

            TimeInterval timeIntervalMoveForward = new TimeInterval( start, end );
            TimeSpan forwardOffset = new TimeSpan( 2, 30, 15 );
            timeIntervalMoveForward.Move( forwardOffset );
            Assert.AreEqual( timeIntervalMoveForward.Start, start.Add( forwardOffset ) );
            Assert.AreEqual( timeIntervalMoveForward.End, end.Add( forwardOffset ) );

            TimeInterval timeIntervalMoveBackward = new TimeInterval( start, end );
            TimeSpan backwardOffset = new TimeSpan( -1, 10, 30 );
            timeIntervalMoveBackward.Move( backwardOffset );
            Assert.AreEqual( timeIntervalMoveBackward.Start, start.Add( backwardOffset ) );
            Assert.AreEqual( timeIntervalMoveBackward.End, end.Add( backwardOffset ) );
        }
        public void IsSamePeriodTest()
        {
            TimeInterval timeInterval1 = new TimeInterval( start, end );
            TimeInterval timeInterval2 = new TimeInterval( start, end );

            Assert.IsTrue( timeInterval1.IsSamePeriod( timeInterval1 ) );
            Assert.IsTrue( timeInterval2.IsSamePeriod( timeInterval2 ) );

            Assert.IsTrue( timeInterval1.IsSamePeriod( timeInterval2 ) );
            Assert.IsTrue( timeInterval2.IsSamePeriod( timeInterval1 ) );

            Assert.IsFalse( timeInterval1.IsSamePeriod( TimeInterval.Anytime ) );
            Assert.IsFalse( timeInterval2.IsSamePeriod( TimeInterval.Anytime ) );

            timeInterval1.Move( new TimeSpan( 1 ) );
            Assert.IsFalse( timeInterval1.IsSamePeriod( timeInterval2 ) );
            Assert.IsFalse( timeInterval2.IsSamePeriod( timeInterval1 ) );

            timeInterval1.Move( new TimeSpan( -1 ) );
            Assert.IsTrue( timeInterval1.IsSamePeriod( timeInterval2 ) );
            Assert.IsTrue( timeInterval2.IsSamePeriod( timeInterval1 ) );
        }