@@ -15,9 +15,9 @@ namespace FluentAssertions.Reactive
15
15
/// <typeparam name="TPayload"></typeparam>
16
16
public class FluentTestObserver < TPayload > : IObserver < TPayload > , IDisposable
17
17
{
18
- private readonly IDisposable subscription ;
19
- private readonly IScheduler observeScheduler ;
20
- private readonly RollingReplaySubject < Recorded < Notification < TPayload > > > rollingReplaySubject = new RollingReplaySubject < Recorded < Notification < TPayload > > > ( ) ;
18
+ private readonly IDisposable _subscription ;
19
+ private readonly IScheduler _observeScheduler ;
20
+ private readonly RollingReplaySubject < Recorded < Notification < TPayload > > > _rollingReplaySubject = new RollingReplaySubject < Recorded < Notification < TPayload > > > ( ) ;
21
21
22
22
/// <summary>
23
23
/// The observable which is observed by this instance
@@ -27,13 +27,13 @@ public class FluentTestObserver<TPayload> : IObserver<TPayload>, IDisposable
27
27
/// <summary>
28
28
/// The stream of recorded <see cref="Notification{T}"/>s
29
29
/// </summary>
30
- public IObservable < Recorded < Notification < TPayload > > > RecordedNotificationStream => rollingReplaySubject . AsObservable ( ) ;
30
+ public IObservable < Recorded < Notification < TPayload > > > RecordedNotificationStream => _rollingReplaySubject . AsObservable ( ) ;
31
31
32
32
/// <summary>
33
33
/// The recorded <see cref="Notification{T}"/>s
34
34
/// </summary>
35
35
public IEnumerable < Recorded < Notification < TPayload > > > RecordedNotifications =>
36
- rollingReplaySubject . GetSnapshot ( ) ;
36
+ _rollingReplaySubject . GetSnapshot ( ) ;
37
37
38
38
/// <summary>
39
39
/// The recorded messages
@@ -64,8 +64,8 @@ public class FluentTestObserver<TPayload> : IObserver<TPayload>, IDisposable
64
64
public FluentTestObserver ( IObservable < TPayload > subject )
65
65
{
66
66
Subject = subject ;
67
- observeScheduler = new EventLoopScheduler ( ) ;
68
- subscription = new CompositeDisposable ( ) ; subject . ObserveOn ( observeScheduler ) . Subscribe ( this ) ;
67
+ _observeScheduler = new EventLoopScheduler ( ) ;
68
+ _subscription = subject . ObserveOn ( _observeScheduler ) . Subscribe ( this ) ;
69
69
}
70
70
71
71
/// <summary>
@@ -76,8 +76,8 @@ public FluentTestObserver(IObservable<TPayload> subject)
76
76
public FluentTestObserver ( IObservable < TPayload > subject , IScheduler scheduler )
77
77
{
78
78
Subject = subject ;
79
- observeScheduler = scheduler ;
80
- subscription = subject . ObserveOn ( scheduler ) . Subscribe ( this ) ;
79
+ _observeScheduler = scheduler ;
80
+ _subscription = subject . ObserveOn ( scheduler ) . Subscribe ( this ) ;
81
81
}
82
82
83
83
/// <summary>
@@ -88,35 +88,35 @@ public FluentTestObserver(IObservable<TPayload> subject, IScheduler scheduler)
88
88
public FluentTestObserver ( IObservable < TPayload > subject , TestScheduler testScheduler )
89
89
{
90
90
Subject = subject ;
91
- observeScheduler = testScheduler ;
92
- subscription = subject . ObserveOn ( Scheduler . CurrentThread ) . Subscribe ( this ) ;
91
+ _observeScheduler = testScheduler ;
92
+ _subscription = subject . ObserveOn ( Scheduler . CurrentThread ) . Subscribe ( this ) ;
93
93
}
94
94
95
95
/// <summary>
96
96
/// Clears the recorded notifications and messages as well as the recorded notifications stream buffer
97
97
/// </summary>
98
- public void Clear ( ) => rollingReplaySubject . Clear ( ) ;
98
+ public void Clear ( ) => _rollingReplaySubject . Clear ( ) ;
99
99
100
100
/// <inheritdoc />
101
101
public void OnNext ( TPayload value )
102
102
{
103
- rollingReplaySubject . OnNext (
104
- new Recorded < Notification < TPayload > > ( observeScheduler . Now . UtcTicks , Notification . CreateOnNext ( value ) ) ) ;
103
+ _rollingReplaySubject . OnNext (
104
+ new Recorded < Notification < TPayload > > ( _observeScheduler . Now . UtcTicks , Notification . CreateOnNext ( value ) ) ) ;
105
105
}
106
106
107
107
/// <inheritdoc />
108
108
public void OnError ( Exception exception ) =>
109
- rollingReplaySubject . OnNext ( new Recorded < Notification < TPayload > > ( observeScheduler . Now . UtcTicks , Notification . CreateOnError < TPayload > ( exception ) ) ) ;
109
+ _rollingReplaySubject . OnNext ( new Recorded < Notification < TPayload > > ( _observeScheduler . Now . UtcTicks , Notification . CreateOnError < TPayload > ( exception ) ) ) ;
110
110
111
111
/// <inheritdoc />
112
112
public void OnCompleted ( ) =>
113
- rollingReplaySubject . OnNext ( new Recorded < Notification < TPayload > > ( observeScheduler . Now . UtcTicks , Notification . CreateOnCompleted < TPayload > ( ) ) ) ;
113
+ _rollingReplaySubject . OnNext ( new Recorded < Notification < TPayload > > ( _observeScheduler . Now . UtcTicks , Notification . CreateOnCompleted < TPayload > ( ) ) ) ;
114
114
115
115
/// <inheritdoc />
116
116
public void Dispose ( )
117
117
{
118
- subscription ? . Dispose ( ) ;
119
- rollingReplaySubject ? . Dispose ( ) ;
118
+ _subscription ? . Dispose ( ) ;
119
+ _rollingReplaySubject ? . Dispose ( ) ;
120
120
}
121
121
122
122
/// <summary>
0 commit comments