Ejemplo n.º 1
0
            public void ShouldRemoveSingleItem()
            {
                // Arrange
                TestObservableObject objectToRemove = TestObservableObjectFaker.Create().Generate();
                var collection = new ObservableItemCollection <TestObservableObject> {
                    objectToRemove
                };

                // Act
                collection.Remove(objectToRemove);

                // Assert
                collection.ShouldNotContain(objectToRemove);
            }
Ejemplo n.º 2
0
            public void ShouldRemoveRangeOfItems()
            {
                // Arrange
                List <TestObservableObject> items = TestObservableObjectFaker.Create().Generate(10);
                var itemsToRemove = items.Take(5).ToList();

                var collection = new ObservableItemCollection <TestObservableObject>(items);

                // Act
                collection.RemoveRange(itemsToRemove);

                // Assert
                foreach (TestObservableObject item in itemsToRemove)
                {
                    collection.ShouldNotContain(item);
                }
            }