/// <summary>
        /// Initializes a new instance of the <see cref="TimeSetter"/> class.
        /// </summary>
        /// <param name="timeProvider">The time provider to set as current TimeProvider.</param>
        public TimeSetter(TimeProvider timeProvider)
        {
            Contract.Requires(timeProvider != null);

            previousProvider = TimeProvider.Current;
            TimeProvider.Current = timeProvider;
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeSetter"/> class.
 /// </summary>
 /// <param name="timeProvider">The time provider to set as current TimeProvider.</param>
 public TimeSetter(TimeProvider timeProvider)
 {
     previousProvider     = TimeProvider.Current;
     TimeProvider.Current = timeProvider;
 }