You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
18
18
Overriding `CreateManualTimer` makes it possible to intercept a `TimerCallback` and perform actions before and after the timer callback has been invoked.
19
19
20
-
- Replace `AutoAdvanceAmount` property with the `AutoAdvanceBehavior` property on `ManualTimeProvider`, and introduced the `AutoAdvanceBehavior` type.
20
+
- Replace `AutoAdvanceAmount` property with the `AutoAdvanceBehavior` property on `ManualTimeProvider`, and introduced the `AutoAdvanceBehavior` type. To automatically advance time when `GetUtcNow()` or `GetLocalNow()` is called, set `AutoAdvanceBehavior.UtcNowAdvanceAmount` to a time span larger than zero.
21
21
22
-
- Enable auto advance feature for `GetTimestamp()` and `GetElapsedTime(long)`.
22
+
- Enable auto advance feature for `GetTimestamp()` and `GetElapsedTime(long)`. To automatically advance time when `GetTimestamp()` or `GetElapsedTime(long)` is called, set `AutoAdvanceBehavior.TimestampAdvanceAmount` to a time span larger than zero.
Copy file name to clipboardExpand all lines: src/TimeProviderExtensions/ManualTimeProvider.cs
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -124,8 +124,8 @@ public override long GetTimestamp()
124
124
/// all according to this <see cref="ManualTimeProvider"/>'s notion of time.
125
125
/// </summary>
126
126
/// <remarks>
127
-
/// If <see cref="AutoAdvanceBehavior.ClockAdvanceAmount"/> is greater than <see cref="TimeSpan.Zero"/>, calling this
128
-
/// method will move time forward by the amount specified by <see cref="AutoAdvanceBehavior.ClockAdvanceAmount"/>.
127
+
/// If <see cref="AutoAdvanceBehavior.UtcNowAdvanceAmount"/> is greater than <see cref="TimeSpan.Zero"/>, calling this
128
+
/// method will move time forward by the amount specified by <see cref="AutoAdvanceBehavior.UtcNowAdvanceAmount"/>.
129
129
/// The <see cref="DateTimeOffset"/> returned from this method will reflect the time before
130
130
/// the auto advance was applied, if any.
131
131
/// </remarks>
@@ -136,7 +136,7 @@ public override DateTimeOffset GetUtcNow()
136
136
lock(callbacks)
137
137
{
138
138
result=utcNow;
139
-
Advance(AutoAdvanceBehavior.ClockAdvanceAmount);
139
+
Advance(AutoAdvanceBehavior.UtcNowAdvanceAmount);
140
140
}
141
141
142
142
returnresult;
@@ -248,7 +248,7 @@ public void SetLocalTimeZone(TimeZoneInfo localTimeZone)
248
248
/// <em>3 seconds</em>, <em>3 seconds</em>, and <em>3 seconds</em>, use <see cref="Jump(DateTimeOffset)"/> or <see cref="Jump(TimeSpan)"/> instead.
249
249
/// </para>
250
250
/// <para>
251
-
/// Learn more about this behavior at <seealso href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
251
+
/// Learn more about this behavior at <see href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
252
252
/// </para>
253
253
/// </remarks>
254
254
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="delta"/> is negative. Going back in time is not supported.</exception>
@@ -306,7 +306,7 @@ public void Advance(TimeSpan delta)
306
306
/// <em>3 seconds</em>, <em>3 seconds</em>, and <em>3 seconds</em>, use <see cref="Jump(DateTimeOffset)"/> or <see cref="Jump(TimeSpan)"/> instead.
307
307
/// </para>
308
308
/// <para>
309
-
/// Learn more about this behavior at <seealso href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
309
+
/// Learn more about this behavior at <see href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
310
310
/// </para>
311
311
/// </remarks>
312
312
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is less than the value returned by <see cref="GetUtcNow()"/>. Going back in time is not supported.</exception>
@@ -389,7 +389,7 @@ public void SetUtcNow(DateTimeOffset value)
389
389
/// use <see cref="Advance(TimeSpan)"/> or <see cref="SetUtcNow(DateTimeOffset)"/> instead.
390
390
/// </para>
391
391
/// <para>
392
-
/// Learn more about this behavior at <seealso href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
392
+
/// Learn more about this behavior at <see href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
393
393
/// </para>
394
394
/// </remarks>
395
395
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="delta"/> is negative. Going back in time is not supported.</exception>
@@ -446,7 +446,7 @@ public void Jump(TimeSpan delta)
446
446
/// use <see cref="Advance(TimeSpan)"/> or <see cref="SetUtcNow(DateTimeOffset)"/> instead.
447
447
/// </para>
448
448
/// <para>
449
-
/// Learn more about this behavior at <seealso href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
449
+
/// Learn more about this behavior at <see href="https://github.com/egil/TimeProviderExtensions/#difference-between-manualtimeprovider-and-faketimeprovider"/>.
450
450
/// </para>
451
451
/// </remarks>
452
452
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is less than the value returned by <see cref="GetUtcNow()"/>. Going back in time is not supported.</exception>
0 commit comments