예제 #1
0
        public void WhenClearIsCalled_GetSubsequentEventsShouldReturnEmptyCollection()
        {
            _sut.Add(new Event("_", id: "1"));
            _sut.Add(new Event("_", id: "2"));

            _sut.Clear();

            var events = _sut.GetSubsequentEvents("1");

            events.Should().BeEmpty();
        }
예제 #2
0
 private void UpdateReaderList(object parameter)
 {
     Readers.Clear();
     EventHistory.Clear();
     using (var ctx = _contextFactory.Establish(SCardScope.System)) {
         foreach (var reader in ctx.GetReaders())
         {
             Readers.Add(reader);
         }
     }
     _subscription?.Dispose();
     if (Readers.Count > 0)
     {
         _subscription = _monitorFactory
                         .CreateObservable(SCardScope.System, Readers)
                         .ObserveOn(_uiScheduler) // Important! Monitor does not run on UI thread.
                         .Subscribe(OnNext, OnError);
     }
 }
예제 #3
0
 private void OnError(Exception exception)
 {
     Debug.Print(exception.Message);
     Readers.Clear();
     EventHistory.Clear();
 }