public void Setup() { var originalList = new List<NotifyingStringClass> { new NotifyingStringClass() }; this.trackingObservableCollection = new TrackingObservableCollection<NotifyingStringClass>(originalList); this.trackingObservableCollection.TrackingObservableCollectionChanged += (sender, eventArgs) => { this.trackingState = eventArgs.TrackingState; }; }
public void Setup() { var originalList = new List <NotifyingStringClass> { new NotifyingStringClass() }; this.trackingObservableCollection = new TrackingObservableCollection <NotifyingStringClass>(originalList); this.trackingObservableCollection.TrackingObservableCollectionChanged += (sender, eventArgs) => { this.trackingState = eventArgs.TrackingState; }; }
public void ReturnAddedGivenAddedItem() { var listOfItems = new List<NotifyingStringClass>(); var trackingCollection = new TrackingObservableCollection<NotifyingStringClass>(listOfItems); var addedItem = new NotifyingStringClass { Value = "SomeValue" }; trackingCollection.Add(addedItem); var itemStatus = trackingCollection.GetTrackingState(addedItem); Assert.IsTrue(itemStatus.Equals(TrackingState.Added)); }
public void ReturnUnchangedGivenUnchangedItem() { var item = new NotifyingStringClass { Value = "SomeValue" }; var originalList = new List<NotifyingStringClass>(); originalList.Add(item); var trackingCollection = new TrackingObservableCollection<NotifyingStringClass>(originalList); var itemStatus = trackingCollection.GetTrackingState(item); Assert.IsTrue(itemStatus.Equals(TrackingState.Unchanged)); }
public void ReturnUnchangedGivenUnchangedItem() { var item = new NotifyingStringClass { Value = "SomeValue" }; var originalList = new List <NotifyingStringClass>(); originalList.Add(item); var trackingCollection = new TrackingObservableCollection <NotifyingStringClass>(originalList); var itemStatus = trackingCollection.GetTrackingState(item); Assert.IsTrue(itemStatus.Equals(TrackingState.Unchanged)); }
public void ReturnAddedGivenAddedItem() { var listOfItems = new List <NotifyingStringClass>(); var trackingCollection = new TrackingObservableCollection <NotifyingStringClass>(listOfItems); var addedItem = new NotifyingStringClass { Value = "SomeValue" }; trackingCollection.Add(addedItem); var itemStatus = trackingCollection.GetTrackingState(addedItem); Assert.IsTrue(itemStatus.Equals(TrackingState.Added)); }