public void RefreshNulls() { var source = new[] { 1, 2, 3 }; var synchronizer = new CollectionSynchronizer <int>(new int[0]); synchronizer.Refresh(source); CollectionAssert.AreEqual(source, synchronizer); }
public void RefreshNulls() { var source = new[] { 1, 2, 3 }; var synchronizer = new CollectionSynchronizer <int>(new int[0]); var current = synchronizer.Current; synchronizer.Refresh(this, source, null, null, null, null); CollectionAssert.AreEqual(source, synchronizer.Current); Assert.AreSame(current, synchronizer.Current); }
public void RefreshSignals() { var source = new ObservableCollection <int>(); var synchronizer = new CollectionSynchronizer <int>(source); using var expected = source.SubscribeAll(); using var actual = this.SubscribeAll(); source.Add(1); synchronizer.Refresh(source, null, this.OnPropertyChanged, this.OnCollectionChanged); CollectionAssert.AreEqual(source, synchronizer); CollectionAssert.AreEqual(expected, actual, EventArgsComparer.Default); }
public void RefreshSignalsWithScheduler() { var source = new ObservableCollection <int>(); var synchronizer = new CollectionSynchronizer <int>(source); var expected = source.SubscribeAll(); var actual = this.SubscribeAll(); source.Add(1); var scheduler = new TestScheduler(); synchronizer.Refresh(this, source, null, scheduler, PropertyChanged, CollectionChanged); CollectionAssert.AreEqual(source, synchronizer.Current); CollectionAssert.IsEmpty(actual.OfType <NotifyCollectionChangedEventArgs>()); scheduler.Start(); CollectionAssert.AreEqual(expected, actual, EventArgsComparer.Default); }