diff --git a/src/R3/FrameProvider.cs b/src/R3/FrameProvider.cs index db11e27c..cd9bf891 100644 --- a/src/R3/FrameProvider.cs +++ b/src/R3/FrameProvider.cs @@ -12,13 +12,13 @@ public interface IFrameRunnerWorkItem bool MoveNext(long frameCount); } -public sealed class ManualFrameProvider : FrameProvider +public sealed class FakeFrameProvider : FrameProvider { long frameCount; readonly object gate = new object(); FreeListCore list; - public ManualFrameProvider() + public FakeFrameProvider() { list = new FreeListCore(gate); } diff --git a/tests/R3.Tests/FactoryTests/EveryUpdateTest.cs b/tests/R3.Tests/FactoryTests/EveryUpdateTest.cs index 1801e2b4..a53f5d11 100644 --- a/tests/R3.Tests/FactoryTests/EveryUpdateTest.cs +++ b/tests/R3.Tests/FactoryTests/EveryUpdateTest.cs @@ -6,7 +6,7 @@ public class EveryUpdateTest public void EveryUpdateCancelImmediate() { var cts = new CancellationTokenSource(); - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var list = Observable.EveryUpdate(frameProvider, cts.Token).Select(_ => frameProvider.GetFrameCount()).ToLiveList(); @@ -29,7 +29,7 @@ public void EveryUpdateCancelImmediate() [Fact] public void EveryUpdateDispose() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var list = Observable.EveryUpdate(frameProvider).Select(_ => frameProvider.GetFrameCount()).ToLiveList(); diff --git a/tests/R3.Tests/FactoryTests/EveryValueChangedTest.cs b/tests/R3.Tests/FactoryTests/EveryValueChangedTest.cs index 82d72634..cdac0fc8 100644 --- a/tests/R3.Tests/FactoryTests/EveryValueChangedTest.cs +++ b/tests/R3.Tests/FactoryTests/EveryValueChangedTest.cs @@ -6,7 +6,7 @@ public class EveryValueChangedTest [Fact] public void EveryValueChanged() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var t = new Target(); t.MyProperty = 99; diff --git a/tests/R3.Tests/FactoryTests/ReturnFrameTest.cs b/tests/R3.Tests/FactoryTests/ReturnFrameTest.cs index ae14dd43..b0e827bd 100644 --- a/tests/R3.Tests/FactoryTests/ReturnFrameTest.cs +++ b/tests/R3.Tests/FactoryTests/ReturnFrameTest.cs @@ -7,7 +7,7 @@ public class ReturnFrameTest [Fact] public void UnitTest() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.YieldFrame(frameProvider, cts.Token).ToLiveList(); @@ -22,7 +22,7 @@ public void UnitTest() public void ValueTest() { { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.ReturnFrame(10, frameProvider, cts.Token).ToLiveList(); @@ -33,7 +33,7 @@ public void ValueTest() list.AssertEqual([10]); } { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.ReturnFrame(10, frameProvider, cts.Token).ToLiveList(); @@ -47,7 +47,7 @@ public void ValueTest() [Fact] public void TimeTest() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.ReturnFrame(10, 5, frameProvider, cts.Token).ToLiveList(); @@ -65,7 +65,7 @@ public void TimeTest() public void NextFrameTest() { { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.NextFrame(frameProvider, cts.Token).ToLiveList(); @@ -79,7 +79,7 @@ public void NextFrameTest() list.AssertEqual(Unit.Default); } { - var frameProvider = new ManualFrameProvider(); // use custom fake + var frameProvider = new FakeFrameProvider(); // use custom fake var cts = new CancellationTokenSource(); var list = Observable.YieldFrame(frameProvider, cts.Token).ToLiveList(); diff --git a/tests/R3.Tests/FactoryTests/TimerFrameTest.cs b/tests/R3.Tests/FactoryTests/TimerFrameTest.cs index e9b0e423..7e9e2635 100644 --- a/tests/R3.Tests/FactoryTests/TimerFrameTest.cs +++ b/tests/R3.Tests/FactoryTests/TimerFrameTest.cs @@ -7,21 +7,21 @@ public class TimerFrameTest public void TimerSingle() { { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.TimerFrame(0, fakeTime).ToLiveList(); fakeTime.Advance(1); list.AssertIsCompleted(); list.AssertEqual([Unit.Default]); } { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.TimerFrame(1, fakeTime).ToLiveList(); fakeTime.Advance(1); list.AssertIsCompleted(); list.AssertEqual([Unit.Default]); } { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.TimerFrame(2, fakeTime).ToLiveList(); fakeTime.Advance(2); list.AssertIsCompleted(); @@ -32,7 +32,7 @@ public void TimerSingle() [Fact] public void TimerSingle2() { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.TimerFrame(5, fakeTime).ToLiveList(); @@ -48,7 +48,7 @@ public void TimerSingle2() public void TimerMulti() { var cts = new CancellationTokenSource(); - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.TimerFrame(5, 8, fakeTime, cts.Token).ToLiveList(); @@ -76,7 +76,7 @@ public void TimerMulti() public void Interval() { var cts = new CancellationTokenSource(); - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var list = Observable.IntervalFrame(5, fakeTime, cts.Token).ToLiveList(); diff --git a/tests/R3.Tests/OperatorTests/ChunkTest.cs b/tests/R3.Tests/OperatorTests/ChunkTest.cs index 54b44bf0..e0926cb1 100644 --- a/tests/R3.Tests/OperatorTests/ChunkTest.cs +++ b/tests/R3.Tests/OperatorTests/ChunkTest.cs @@ -168,7 +168,7 @@ public void ChunkWindowBoundary() [Fact] public void ChunkFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.ChunkFrame(3, frameProvider).ToLiveList(); @@ -208,7 +208,7 @@ public void ChunkFrame() [Fact] public void ChunkFrameAndCount() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.ChunkFrame(3, 2, frameProvider).ToLiveList(); diff --git a/tests/R3.Tests/OperatorTests/DebounceThrottleFirstSampleTest.cs b/tests/R3.Tests/OperatorTests/DebounceThrottleFirstSampleTest.cs index 3ad5396d..843c5df2 100644 --- a/tests/R3.Tests/OperatorTests/DebounceThrottleFirstSampleTest.cs +++ b/tests/R3.Tests/OperatorTests/DebounceThrottleFirstSampleTest.cs @@ -124,7 +124,7 @@ public void Sample() [Fact] public void DebounceFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.DebounceFrame(3, frameProvider).ToLiveList(); @@ -170,7 +170,7 @@ public void DebounceFrame() [Fact] public void ThrottleFirstFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.ThrottleFirstFrame(3, frameProvider).ToLiveList(); @@ -205,7 +205,7 @@ public void ThrottleFirstFrame() [Fact] public void SampleFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.ThrottleLastFrame(3, frameProvider).ToLiveList(); diff --git a/tests/R3.Tests/OperatorTests/DelaySubscriptionTest.cs b/tests/R3.Tests/OperatorTests/DelaySubscriptionTest.cs index 0331ff07..d51a29f1 100644 --- a/tests/R3.Tests/OperatorTests/DelaySubscriptionTest.cs +++ b/tests/R3.Tests/OperatorTests/DelaySubscriptionTest.cs @@ -38,7 +38,7 @@ public void DelaySubscription() [Fact] public void DelaySubscriptionFrame() { - var provider = new ManualFrameProvider(); + var provider = new FakeFrameProvider(); var publisher = new Subject(); var subscribed = false; diff --git a/tests/R3.Tests/OperatorTests/DelayTest.cs b/tests/R3.Tests/OperatorTests/DelayTest.cs index 02700767..bb9beab5 100644 --- a/tests/R3.Tests/OperatorTests/DelayTest.cs +++ b/tests/R3.Tests/OperatorTests/DelayTest.cs @@ -54,7 +54,7 @@ public void Delay() [Fact] public void DelayFrame() { - var provider = new ManualFrameProvider(); + var provider = new FakeFrameProvider(); var subject = new Subject(); var e = new List(); diff --git a/tests/R3.Tests/OperatorTests/ObserveOnTest.cs b/tests/R3.Tests/OperatorTests/ObserveOnTest.cs index 25b6c8d8..c012917c 100644 --- a/tests/R3.Tests/OperatorTests/ObserveOnTest.cs +++ b/tests/R3.Tests/OperatorTests/ObserveOnTest.cs @@ -52,7 +52,7 @@ public void TimeProvider() [Fact] public void FrameProvider() { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var publisher = new Subject(); using var list = publisher.ObserveOn(fakeTime).ToLiveList(); @@ -77,7 +77,7 @@ public void FrameProvider() public void FrameProvider2() { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var publisher = new Subject(); using var list = publisher.ObserveOn(fakeTime) diff --git a/tests/R3.Tests/OperatorTests/SkipLastTest.cs b/tests/R3.Tests/OperatorTests/SkipLastTest.cs index 1fcbec6d..03413f46 100644 --- a/tests/R3.Tests/OperatorTests/SkipLastTest.cs +++ b/tests/R3.Tests/OperatorTests/SkipLastTest.cs @@ -40,7 +40,7 @@ public void SkipTime() [Fact] public void SkipFrame2() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.EveryUpdate(frameProvider, cts.Token) diff --git a/tests/R3.Tests/OperatorTests/SkipTest.cs b/tests/R3.Tests/OperatorTests/SkipTest.cs index 6218a91a..5e3a4569 100644 --- a/tests/R3.Tests/OperatorTests/SkipTest.cs +++ b/tests/R3.Tests/OperatorTests/SkipTest.cs @@ -52,7 +52,7 @@ public void SkipTime() [Fact] public void SkipFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.SkipFrame(3, frameProvider).ToLiveList(); diff --git a/tests/R3.Tests/OperatorTests/SubscribeOnTest.cs b/tests/R3.Tests/OperatorTests/SubscribeOnTest.cs index 4dab58c2..bb7f05f9 100644 --- a/tests/R3.Tests/OperatorTests/SubscribeOnTest.cs +++ b/tests/R3.Tests/OperatorTests/SubscribeOnTest.cs @@ -53,7 +53,7 @@ public void TimeProvider() public void FrameProvider() { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var subscribed = false; using var list = Observable.Range(1, 10) .Do(onSubscribe: () => subscribed = true) diff --git a/tests/R3.Tests/OperatorTests/TakeLastTest.cs b/tests/R3.Tests/OperatorTests/TakeLastTest.cs index 8cfbdaf3..71e72284 100644 --- a/tests/R3.Tests/OperatorTests/TakeLastTest.cs +++ b/tests/R3.Tests/OperatorTests/TakeLastTest.cs @@ -40,7 +40,7 @@ public void TakeTime() [Fact] public void TakeFrame2() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var cts = new CancellationTokenSource(); var list = Observable.EveryUpdate(frameProvider, cts.Token) diff --git a/tests/R3.Tests/OperatorTests/TakeTest.cs b/tests/R3.Tests/OperatorTests/TakeTest.cs index 0c7293e3..244b4892 100644 --- a/tests/R3.Tests/OperatorTests/TakeTest.cs +++ b/tests/R3.Tests/OperatorTests/TakeTest.cs @@ -34,7 +34,7 @@ public async Task Take() [Fact] public void TakeFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.TakeFrame(5, frameProvider).ToLiveList(); @@ -54,7 +54,7 @@ public void TakeFrame() [Fact] public void TakeFrame2() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var list = Observable.EveryUpdate(frameProvider) .Select(x => frameProvider.GetFrameCount()) diff --git a/tests/R3.Tests/OperatorTests/TimeoutTest.cs b/tests/R3.Tests/OperatorTests/TimeoutTest.cs index db0c54ac..2eac4990 100644 --- a/tests/R3.Tests/OperatorTests/TimeoutTest.cs +++ b/tests/R3.Tests/OperatorTests/TimeoutTest.cs @@ -31,7 +31,7 @@ public void Timeout() [Fact] public void TimeoutFrame() { - var frameProvider = new ManualFrameProvider(); + var frameProvider = new FakeFrameProvider(); var publisher = new Subject(); var list = publisher.TimeoutFrame(3, frameProvider).ToLiveList(); diff --git a/tests/R3.Tests/ReplayFrameSubjectTest .cs b/tests/R3.Tests/ReplayFrameSubjectTest .cs index d443eaef..7c74ff36 100644 --- a/tests/R3.Tests/ReplayFrameSubjectTest .cs +++ b/tests/R3.Tests/ReplayFrameSubjectTest .cs @@ -5,7 +5,7 @@ public class ReplayFrameSubjectTest [Fact] public void ReplayTime() { - var fakeTime = new ManualFrameProvider(); + var fakeTime = new FakeFrameProvider(); var subject = new ReplayFrameSubject((3), fakeTime);