-
-
Save stimms/4487220 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void timeout() | |
{ | |
var observable = Observable.Never<decimal>(); | |
int timesRun = 0; | |
int timeouts = 0; | |
observable.Subscribe(x => timesRun++); | |
var testScheduler = new TestScheduler(); | |
observable.Timeout(TimeSpan.FromSeconds(1), testScheduler).Subscribe(x => timesRun++, | |
e => | |
{ | |
timeouts++; | |
}); | |
Assert.Equal(0, timesRun); | |
testScheduler.AdvanceBy(TimeSpan.FromSeconds(1).Ticks - 1); | |
Assert.Equal(0, timeouts); | |
testScheduler.AdvanceBy(1); | |
//testScheduler.Start(); | |
Assert.Equal(1, timeouts); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment