public TicTacToePage() { InitializeComponent(); _state = new BasicObserver <MatchState>(); BackButton.Hide(); _gameOver = false; }
public TicTacToePage() { InitializeComponent(); _state = new BasicObserver<MatchState>(); BackButton.Hide(); _gameOver = false; }
private void ExitGame() { Dispose(); UpdateTimer.Enabled = false; _state = new BasicObserver<MatchState>(); _gameOver = false; var mainMenu = new MainMenu(); mainMenu.ShowDialog(); }
private void ExitGame() { Dispose(); UpdateTimer.Enabled = false; _state = new BasicObserver <MatchState>(); _gameOver = false; var mainMenu = new MainMenu(); mainMenu.ShowDialog(); }
public async void Normal() { var result = AsyncEnumerable.Range(1, 5) .ToObservable(); var consumer = new BasicObserver <int>(); using (result.Subscribe(consumer)) { await consumer.TerminateTask; Assert.Equal(new List <int>(new[] { 1, 2, 3, 4, 5 }), consumer.Values); Assert.Null(consumer.Error); Assert.True(consumer.Completed); } }
public async void Error() { var ex = new InvalidOperationException(); var result = AsyncEnumerable.Error <int>(ex) .ToObservable(); var consumer = new BasicObserver <int>(); using (result.Subscribe(consumer)) { await consumer.TerminateTask; Assert.Empty(consumer.Values); Assert.Same(ex, consumer.Error); Assert.False(consumer.Completed); } }
public async void Take() { var consumer = new BasicObserver <long>(); using (AsyncEnumerable.Timer(TimeSpan.FromMilliseconds(200)) .ToObservable() .Subscribe(consumer)) { await Task.Delay(100); } await Task.Delay(200); Assert.Empty(consumer.Values); Assert.Null(consumer.Error); Assert.False(consumer.Completed); }