Skip to content

Commit 8de749f

Browse files
Paulo Morgadodanielcweber
authored andcommitted
Added debugger display information to TestScheduler and HistoricalScheduler
(cherry picked from commit 72c3b7d)
1 parent 1a5abeb commit 8de749f

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

Rx.NET/Source/src/Microsoft.Reactive.Testing/TestScheduler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6+
using System.Diagnostics;
67
using System.Reactive;
78
using System.Reactive.Concurrency;
89
using System.Reactive.Disposables;
@@ -12,6 +13,10 @@ namespace Microsoft.Reactive.Testing
1213
/// <summary>
1314
/// Virtual time scheduler used for testing applications and libraries built using Reactive Extensions.
1415
/// </summary>
16+
[DebuggerDisplay("\\{ " +
17+
nameof(Clock) + " = {" + nameof(Clock) + "} " +
18+
nameof(Now) + " = {" + nameof(Now) + ".ToString(\"O\")} " +
19+
"\\}")]
1520
public class TestScheduler : VirtualTimeScheduler<long, long>
1621
{
1722
/// <summary>

Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System.Collections.Generic;
6+
using System.Diagnostics;
67

78
namespace System.Reactive.Concurrency
89
{
@@ -67,6 +68,10 @@ protected override DateTimeOffset Add(DateTimeOffset absolute, TimeSpan relative
6768
/// <summary>
6869
/// Provides a virtual time scheduler that uses <see cref="DateTimeOffset"/> for absolute time and <see cref="TimeSpan"/> for relative time.
6970
/// </summary>
71+
[DebuggerDisplay("\\{ " +
72+
nameof(Clock) + " = {" + nameof(Clock) + "} " +
73+
nameof(Now) + " = {" + nameof(Now) + ".ToString(\"O\")} " +
74+
"\\}")]
7075
public class HistoricalScheduler : HistoricalSchedulerBase
7176
{
7277
private readonly SchedulerQueue<DateTimeOffset> _queue = new SchedulerQueue<DateTimeOffset>();

Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.Core.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ namespace System.Reactive.Concurrency
267267
public System.IDisposable SchedulePeriodic<TState>(TState state, System.TimeSpan period, System.Func<TState, TState> action) { }
268268
public override System.Reactive.Concurrency.IStopwatch StartStopwatch() { }
269269
}
270+
[System.Diagnostics.DebuggerDisplayAttribute("\\{ Clock = {Clock} Now = {Now.ToString(\"O\")} \\}")]
270271
public class HistoricalScheduler : System.Reactive.Concurrency.HistoricalSchedulerBase
271272
{
272273
public HistoricalScheduler() { }

Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.Testing.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ namespace Microsoft.Reactive.Testing
7171
public override int GetHashCode() { }
7272
public override string ToString() { }
7373
}
74+
[System.Diagnostics.DebuggerDisplayAttribute("\\{ Clock = {Clock} Now = {Now.ToString(\"O\")} \\}")]
7475
public class TestScheduler : System.Reactive.Concurrency.VirtualTimeScheduler<long, long>
7576
{
7677
public TestScheduler() { }

0 commit comments

Comments
 (0)