public void Adding_Items_Should_Raise_CollectionChanged() { var target = new PerspexList <int>(new[] { 1, 2 }); var raised = false; target.CollectionChanged += (s, e) => { Assert.Equal(target, s); Assert.Equal(NotifyCollectionChangedAction.Add, e.Action); Assert.Equal(new[] { 3, 4 }, e.NewItems.Cast <int>()); Assert.Equal(2, e.NewStartingIndex); raised = true; }; target.AddRange(new[] { 3, 4 }); Assert.True(raised); }
public void Adding_Items_Should_Raise_CollectionChanged() { var target = new PerspexList<int>(new[] { 1, 2 }); var raised = false; target.CollectionChanged += (s, e) => { Assert.Equal(target, s); Assert.Equal(NotifyCollectionChangedAction.Add, e.Action); Assert.Equal(new[] { 3, 4 }, e.NewItems.Cast<int>()); Assert.Equal(2, e.NewStartingIndex); raised = true; }; target.AddRange(new[] { 3, 4 }); Assert.True(raised); }
public void AddRange_With_Null_Should_Throw_Exception() { var target = new PerspexList <int>(); Assert.Throws <ArgumentNullException>(() => target.AddRange(null)); }
public void AddRange_With_Null_Should_Throw_Exception() { var target = new PerspexList<int>(); Assert.Throws<ArgumentNullException>(() => target.AddRange(null)); }