-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Added Range Manipulation APIs to Collection<T> and ObservableCollection<T> #35772
Added Range Manipulation APIs to Collection<T> and ObservableCollection<T> #35772
Commits on May 2, 2019
-
Added Collection<T> AddRange and InsertRange and added new XUnit test…
…s to cover new APIs Added missing APIs from Collection<T>; Added new unit tests for RemoveRange, ReplaceRange, InsertItemsRange and RemoveItemsRange Updated AddRange in Collection<T> to add items to the end of the collection Added CollectionChanged tests for ObservableCollection<T> for InsertRange, AddRange, RemoveRange and ReplaceRange Removing API changes as these will be mirrored from CoreCLR Updated array assertions to use Span<T> to simplify logic Sorted order of new API methods Simplified CollectionTests Assertion to use Span<T> instead of calling out each item in the array Added missing API ReplaceItemsRange and updated unit tests for check for overflow errors on RemoveItems Added overrides for ObservableCollection<T> ItemsRange API to only fire CollectionChanged once per API call. Before this was firing for each item in the collection which is not the desired result. Updated unit tests to verify this logic Updated RemoveItemsRange to prevent int.MaxValue overflow errors Added int.MaxValue overflow tests for Collection<T> and ObservableCollection<T> when invoking RemoveItemsRange API Added additional RemoveRange unit tests to cover when Count is Less than 0 or when Count is 0 Updated RemoveRange overflow tests to check for ArgumentException for new business rules Updated ObservableCollection overflow test to assert ArgumentException Added try-finally block to ObservableCollection<T> to certify that _skipCollectionChanged is always set to false after a collection manipulation in case an exception is thrown in a subclass. Added new test class to test the new rules on the example of a NonNullObservableCollection<T> CollectionChanged events do not fire on RemoveRange if the count == 0 Updated ObservableCollection<T> to only throw the 3 required events when ReplaceItemsRange is invoked. Updated OnChangedEvent methods to check for IList and cast as necessary. Added additional exception handling to reset _skipRaisingEvents bool. Added unit tests to verify event and event parameters are being passed correctly. Added Collection<T> AddRange and InsertRange and added new XUnit tests to cover new APIs Simplified CollectionTests Assertion to use Span<T> instead of calling out each item in the array Added additional RemoveRange unit tests to cover when Count is Less than 0 or when Count is 0 Updated ObservableCollection<T> to only throw the 3 required events when ReplaceItemsRange is invoked. Updated OnChangedEvent methods to check for IList and cast as necessary. Added additional exception handling to reset _skipRaisingEvents bool. Added unit tests to verify event and event parameters are being passed correctly. Updated ReplaceRange event to pass in the OldItems and NewItems to match the event docs Simplified CollectionChanged 'NewItems for InsertItemsRange Updated removedItems to use an array instead of a List<T> Added new OnCollectionChanged overloads to reduce need for additional if checks. Removed stale code Optimized ReplaceItemsRange by simplifying the itemsToReplace which is no an array instead of a List<T> Removed (IList) cast in ReplaceItemsRange when raising CollectionChanged Removed temp array in RemoveRange which decreases memory allocation needed
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for f4f0d52 - Browse repository at this point
Copy the full SHA f4f0d52View commit details -
Removed redudent AsSpan parameter in test code
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 17e62ef - Browse repository at this point
Copy the full SHA 17e62efView commit details -
Removed stale code in test code
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 5e453ad - Browse repository at this point
Copy the full SHA 5e453adView commit details -
Removed redundent Assert.NotNull calls in several tests
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 512c517 - Browse repository at this point
Copy the full SHA 512c517View commit details -
Added additional check in InsertRange to verify the input collection.…
…Count is greater than 0 before raising the events
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for f4968c9 - Browse repository at this point
Copy the full SHA f4968c9View commit details -
Removed stale code from the
NonNullObservableCollection<T>
test har……ness
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for a50f567 - Browse repository at this point
Copy the full SHA a50f567View commit details -
Removed unnecessary whitespace
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 781612b - Browse repository at this point
Copy the full SHA 781612bView commit details -
Renamed new API tests to include the .netcoreapp extension; Updated .…
…Tests.csproj file to only run them when the project is built under .NET core as net standard is the default
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for afb8909 - Browse repository at this point
Copy the full SHA afb8909View commit details -
Renamed CollectionTests -> CollectionTests.netcoreapp.cs and only run…
… the test if it is a netcoreapp as the new APIs aren't in netstandard yet
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for eb1d802 - Browse repository at this point
Copy the full SHA eb1d802View commit details -
Added UAP and UAPAOT build configurations for System.ObjectModel tests
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 6403a78 - Browse repository at this point
Copy the full SHA 6403a78View commit details -
Updated ObservableCollection/Collection tests that use new APIs to be…
… in a partial class with the .netcoreapp.cs extension and existings tests to be in the .cs file.
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 9ee2e12 - Browse repository at this point
Copy the full SHA 9ee2e12View commit details -
Added CollectionTestBase as parent class for CollectionTests for the …
…use case where the other tests are ignored in netstandard builds
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for d948ef5 - Browse repository at this point
Copy the full SHA d948ef5View commit details -
Adding using statements back in which were failing the build
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 8b527af - Browse repository at this point
Copy the full SHA 8b527afView commit details -
Moving private classes from the netcoreapp tests to the regular Colle…
…ctionTests as they were not available in the netstandard CI test run
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for fa550f4 - Browse repository at this point
Copy the full SHA fa550f4View commit details -
Added missing using statement for colleciton tests
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for d36ec1e - Browse repository at this point
Copy the full SHA d36ec1eView commit details -
Added if-block that certifies we have replaced items before raising t…
…he Replace Event on ReplaceItemsRange
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for e019416 - Browse repository at this point
Copy the full SHA e019416View commit details -
Removed whitespace in System.Runtime.Tests.csproj
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 01b9496 - Browse repository at this point
Copy the full SHA 01b9496View commit details -
Added negative test case for ReplaceRange when no items are replaced
Andrew Hoefling committedMay 2, 2019 Configuration menu - View commit details
-
Copy full SHA for 33bcaa0 - Browse repository at this point
Copy the full SHA 33bcaa0View commit details -
Andrew Hoefling committed
May 2, 2019 Configuration menu - View commit details
-
Copy full SHA for bbf807c - Browse repository at this point
Copy the full SHA bbf807cView commit details