public void RemoveRangeFromSecond_Always_RaisesNotifyCollectionChangedWithRemoveActionAndCorrectValuesForEachItemRemoved() { var continuousSecondCollection = new ContinuousCollection <Person>(_first.ToList()); _target = new ConcatReadOnlyContinuousCollection <Person>(_first, continuousSecondCollection); var eventArgsList = TestUtilities.GetCollectionChangedEventArgsList(_target); continuousSecondCollection.RemoveRange(0, 2); Assert.AreEqual(1, eventArgsList.Count); TestUtilities.AssertRemove(eventArgsList[0], 2, _person1, _person2); }
public void RemoveRangeFromFirst_Always_RaisesNotifyCollectionChangedWithAddActionAndCorrectValues2() { var continuousSecondCollection = new ContinuousCollection <Person>(_first.ToList()); _target = new ExceptReadOnlyContinuousCollection <Person>(_first, continuousSecondCollection); var eventArgsList = TestUtilities.GetCollectionChangedEventArgsList(_target); continuousSecondCollection.RemoveRange(0, 2); Assert.AreEqual(1, eventArgsList.Count); TestUtilities.AssertAdd(eventArgsList[0], 0, _first.ToArray()); }
public void RemoveRange_GoesBeyondIndices_ThrowsException() { _target.RemoveRange(0, 1); }
public void RemoveRangeFromFirst_Always_RaisesNotifyCollectionChangedWithAddActionAndCorrectValues2() { var continuousSecondCollection = new ContinuousCollection<Person>(_first.ToList()); _target = new ExceptReadOnlyContinuousCollection<Person>(_first, continuousSecondCollection); var eventArgsList = TestUtilities.GetCollectionChangedEventArgsList(_target); continuousSecondCollection.RemoveRange(0, 2); Assert.AreEqual(1, eventArgsList.Count); TestUtilities.AssertAdd(eventArgsList[0], 0, _first.ToArray()); }
public void RemoveRangeFromFirst_Always_RaisesNotifyCollectionChangedWithRemoveActionAndCorrectValuesForEachItemRemoved() { var continuousFirstCollection = new ContinuousCollection<Person>(_first.ToList()); _target = new ExceptReadOnlyContinuousCollection<Person>(continuousFirstCollection, _second); var eventArgsList = TestUtilities.GetCollectionChangedEventArgsList(_target); continuousFirstCollection.RemoveRange(0, 2); Assert.AreEqual(2, eventArgsList.Count); TestUtilities.AssertRemove(eventArgsList[0], 0, _person1); TestUtilities.AssertRemove(eventArgsList[1], 0, _person2); }
public void RemoveRange_GoesBeyondIndices_ThrowsException() { var action = new Action(() => _target.RemoveRange(0, 1)); action.Should().Throw <ArgumentOutOfRangeException>(); }