From 4a49e07f76d3c509f7f0cf8a6e4ff5b25400811c Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Tue, 28 Jul 2026 08:26:14 -0700 Subject: [PATCH 1/5] Move to project-level usings across all projects Every namespace that was imported in more than a handful of files is now declared once in the csproj. The only usings left in source files are the four opt-in DynamicData namespaces, which is exactly the point: if a file pulls in Alias, Aggregation, PLinq or Experimental, that should be visible at the top of the file rather than silently applied everywhere. Enabled ImplicitUsings on the tests and benchmarks projects, which the library already had. Three spots needed a source change because globalising the namespaces made a name ambiguous: Notification exists in both System.Reactive and DynamicData.Internal, so the three test utilities that use the Rx one now qualify it. ToHashSet() is offered by both DynamicData.Kernel.EnumerableEx and System.Linq.Enumerable. WhenPropertyChangedRaceFixture now calls Enumerable.ToHashSet directly. Bogus has its own Person type that collides with Domain.Person. Rather than leave Bogus as a file-level using in 26 test files, the tests project pins Person to the domain type with a global alias. That also let the two file-level Person aliases go away. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9582bb33-26d3-4aa5-8dd7-57dc55304680 --- .../Cache/DeliveryQueueBenchmarks.cs | 12 +- .../Cache/DisposeMany_Cache.cs | 4 - src/DynamicData.Benchmarks/Cache/EditDiff.cs | 11 +- .../Cache/ExpireAfter_Cache_ForSource.cs | 10 +- .../Cache/ExpireAfter_Cache_ForStream.cs | 11 +- .../Cache/FilterImmutable.cs | 8 +- .../Cache/Filter_Cache_WithPredicateState.cs | 12 +- .../Cache/SortAndBindChange.cs | 22 +- .../Cache/SortAndBindInitial.cs | 16 +- .../Cache/SourceCache.cs | 5 - .../Cache/StatelessFiltering.cs | 8 +- .../Cache/StatelessTransforming.cs | 9 +- .../Cache/ToObservableChangeSet_Cache.cs | 10 +- .../Cache/TransformImmutable.cs | 9 +- .../Cache/TransformMany.cs | 9 +- .../DynamicData.Benchmarks.csproj | 19 + .../List/DisposeMany_List.cs | 5 - .../List/ExpireAfter_List.cs | 10 +- ...lter_List_Static_RandomizedBoundedEdits.cs | 12 +- ...er_List_Static_RandomizedUnboundedEdits.cs | 12 +- .../List/Filter_List_WithPredicateState.cs | 11 +- src/DynamicData.Benchmarks/List/GroupAdd.cs | 6 - .../List/GroupRemove.cs | 8 +- src/DynamicData.Benchmarks/List/SourceList.cs | 7 +- .../List/ToObservableChangeSet_List.cs | 8 +- .../Polyfills/RequiredMemberAttribute.cs | 2 - src/DynamicData.Benchmarks/Program.cs | 8 +- src/DynamicData.Tests/API/ApiApprovalTests.cs | 6 +- src/DynamicData.Tests/API/ApiExtensions.cs | 10 +- .../AggregationTests/AggregationFixture.cs | 11 +- .../AggregationTests/AverageFixture.cs | 9 +- .../AggregationTests/MaxFixture.cs | 9 +- .../AggregationTests/MinFixture.cs | 9 +- .../AggregationTests/SumFixture.ForCache.cs | 10 +- .../AggregationTests/SumFixture.ForList.cs | 10 +- src/DynamicData.Tests/AutoRefreshFilter.cs | 14 +- .../Binding/AvaloniaDictionaryFixture.cs | 21 +- .../Binding/BindingLIstBindListFixture.cs | 15 +- .../Binding/BindingListBindCacheFixture.cs | 11 - .../BindingListBindCacheSortedFixture.cs | 18 +- .../Binding/BindingListToChangeSetFixture.cs | 14 +- ...eeplyNestedNotifyPropertyChangedFixture.cs | 14 +- .../IObservableListBindCacheFixture.cs | 12 +- .../IObservableListBindCacheSortedFixture.cs | 14 +- .../Binding/IObservableListBindListFixture.cs | 20 +- .../Binding/NotifyPropertyChangedExFixture.cs | 16 +- .../ObservableCollectionBindCacheFixture.cs | 24 +- ...ervableCollectionBindCacheSortedFixture.cs | 23 +- .../ObservableCollectionBindListFixture.cs | 12 +- ...bleCollectionExtendedToChangeSetFixture.cs | 12 +- .../ObservableCollectionToChangeSetFixture.cs | 13 +- ...yObservableCollectionToChangeSetFixture.cs | 13 +- .../ReadonlyCollectionBindCacheFixture.cs | 13 +- .../WhenPropertyChangedBehaviorFixture.cs | 10 - .../Binding/WhenPropertyChangedRaceFixture.cs | 29 +- src/DynamicData.Tests/Cache/AndFixture.cs | 12 +- ...syncDisposeManyFixture.IntegrationTests.cs | 22 +- .../AsyncDisposeManyFixture.UnitTests.cs | 28 +- .../Cache/AsyncDisposeManyFixture.cs | 5 +- .../Cache/AutoRefreshFixture.Base.cs | 46 +- ...AutoRefreshFixture.WithPropertyAccessor.cs | 15 +- ...oRefreshFixture.WithoutPropertyAccessor.cs | 13 +- .../Cache/AutoRefreshFixture.cs | 4 +- .../AutoRefreshOnObservableFixture.Base.cs | 52 +- .../AutoRefreshOnObservableFixture.WithKey.cs | 10 +- ...toRefreshOnObservableFixture.WithoutKey.cs | 10 +- .../Cache/AutoRefreshOnObservableFixture.cs | 8 +- src/DynamicData.Tests/Cache/BatchFixture.cs | 12 +- src/DynamicData.Tests/Cache/BatchIfFixture.cs | 14 +- .../Cache/BatchIfWithTimeOutFixture.cs | 15 +- .../Cache/BufferInitialFixture.cs | 14 +- .../Cache/CrossCacheDeadlockStressTest.cs | 22 - .../Cache/DeadlockTortureTest.cs | 14 +- .../Cache/DeferUntilLoadedFixture.cs | 11 +- .../Cache/DisposeManyFixture.cs | 11 +- .../Cache/DistinctFixture.cs | 12 +- .../Cache/DynamicAndFixture.cs | 11 +- .../Cache/DynamicExceptFixture.cs | 11 +- .../Cache/DynamicOrFixture.cs | 11 +- .../Cache/DynamicXorFixture.cs | 11 +- .../Cache/EditDiffChangeSetFixture.cs | 10 +- .../Cache/EditDiffChangeSetOptionalFixture.cs | 13 +- .../Cache/EditDiffFixture.cs | 11 +- .../Cache/EnsureUniqueKeysFixture.cs | 12 +- src/DynamicData.Tests/Cache/ExceptFixture.cs | 11 +- .../Cache/ExpireAfterFixture.ForSource.cs | 20 +- .../Cache/ExpireAfterFixture.ForStream.cs | 21 +- .../Cache/ExpireAfterFixture.cs | 7 +- .../Cache/FilterFixture.Base.cs | 31 +- ...xture.DynamicPredicate.IntegrationTests.cs | 17 +- ...ilterFixture.DynamicPredicate.UnitTests.cs | 30 +- ...redicateAndReFiltering.IntegrationTests.cs | 18 +- ...ynamicPredicateAndReFiltering.UnitTests.cs | 41 +- ....DynamicPredicateState.IntegrationTests.cs | 16 +- ...Fixture.DynamicPredicateState.UnitTests.cs | 30 +- .../Cache/FilterFixture.Static.cs | 18 +- src/DynamicData.Tests/Cache/FilterFixture.cs | 8 +- .../Cache/FilterImmutableFixture.cs | 29 +- .../Cache/FilterOnConnectFixture.cs | 6 +- .../Cache/FilterOnObservableFixture.cs | 13 +- .../Cache/FilterParallelFixture.cs | 10 +- .../Cache/ForEachChangeFixture.cs | 11 +- .../Cache/FromAsyncFixture.cs | 16 +- .../Cache/FullJoinFixture.cs | 11 +- .../Cache/FullJoinManyFixture.cs | 12 +- .../Cache/GroupControllerFixture.cs | 13 +- .../GroupControllerForFilteredItemsFixture.cs | 13 +- src/DynamicData.Tests/Cache/GroupFixture.cs | 14 +- .../Cache/GroupFromDistinctFixture.cs | 13 +- .../Cache/GroupImmutableFixture.cs | 12 +- .../Cache/GroupOnDynamicFixture.cs | 18 +- .../Cache/GroupOnObservableFixture.cs | 17 +- .../Cache/GroupOnPropertyFixture.cs | 11 +- ...roupOnPropertyWithImmutableStateFixture.cs | 12 +- .../Cache/IgnoreUpdateFixture.cs | 10 +- .../Cache/IncludeUpdateFixture.cs | 10 +- .../Cache/InnerJoinFixture.cs | 18 +- .../Cache/InnerJoinFixtureRaceCondition.cs | 8 +- .../Cache/InnerJoinManyFixture.cs | 20 +- .../Cache/KeyValueCollectionEx.cs | 5 +- .../Cache/LeftJoinFixture.cs | 20 +- .../Cache/LeftJoinManyFixture.cs | 20 +- .../Cache/MergeChangeSetsFixture.cs | 14 +- .../Cache/MergeManyChangeSetsCacheFixture.cs | 20 +- ...ManyChangeSetsCacheSourceCompareFixture.cs | 19 +- .../Cache/MergeManyChangeSetsListFixture.cs | 18 +- .../Cache/MergeManyFixture.cs | 10 +- .../Cache/MergeManyItemsFixture.cs | 10 +- .../Cache/MergeManyWithKeyOverloadFixture.cs | 10 +- .../Cache/MonitorStatusFixture.cs | 12 +- .../Cache/ObservableCachePreviewFixture.cs | 9 +- .../Cache/ObservableChangeSetFixture.cs | 20 +- src/DynamicData.Tests/Cache/OfTypeFixture.cs | 12 +- src/DynamicData.Tests/Cache/OnItemFixture.cs | 12 +- src/DynamicData.Tests/Cache/OrFixture.cs | 12 +- src/DynamicData.Tests/Cache/PageFixture.cs | 14 +- .../Cache/QueryWhenChangedFixture.cs | 10 +- .../Cache/RefCountFixture.cs | 13 +- .../Cache/RemoveKeyFixture.cs | 15 +- .../Cache/RightJoinFixture.cs | 20 +- .../Cache/RightJoinManyFixture.cs | 20 +- .../Cache/SizeLimitFixture.cs | 14 +- .../Cache/SortAndBindFixture.cs | 51 +- .../Cache/SortAndBindObservableFixture.cs | 18 +- .../Cache/SortAndPageAndBindFixture.cs | 25 +- .../Cache/SortAndPageFixture.cs | 28 +- .../Cache/SortAndVirtualizeAndBindFixture.cs | 30 +- .../Cache/SortAndVirtualizeFixture.cs | 30 +- src/DynamicData.Tests/Cache/SortFixture.cs | 16 +- .../Cache/SortObservableFixtureFixture.cs | 14 +- .../Cache/SourceCacheFixture.cs | 20 +- .../Cache/SubscribeManyFixture.cs | 10 +- ...ndNotificationsFixture.IntegrationTests.cs | 13 +- .../SuspendNotificationsFixture.UnitTests.cs | 13 +- src/DynamicData.Tests/Cache/SwitchFixture.cs | 16 +- ...ChangeSetFixture.Items.IntegrationTests.cs | 13 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 52 +- ...geSetFixture.Sequences.IntegrationTests.cs | 13 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 47 +- .../Cache/ToObservableChangeSetFixture.cs | 4 +- .../Cache/ToObservableOptionalFixture.cs | 14 +- .../Cache/ToSortedCollectionFixture.cs | 17 +- .../Cache/TransformAsyncFixture.cs | 20 +- .../Cache/TransformFixture.cs | 13 +- .../Cache/TransformFixtureParallel.cs | 10 +- .../Cache/TransformImmutableFixture.cs | 25 +- .../Cache/TransformManyAsyncFixture.cs | 15 +- .../Cache/TransformManyFixture.cs | 11 +- .../TransformManyObservableCacheFixture.cs | 483 +++++++++--------- .../Cache/TransformManyRefreshFixture.cs | 11 +- .../Cache/TransformManySimpleFixture.cs | 10 +- .../Cache/TransformOnObservableFixture.cs | 18 +- .../Cache/TransformSafeAsyncFixture.cs | 21 +- .../Cache/TransformSafeFixture.cs | 13 +- .../Cache/TransformSafeParallelFixture.cs | 13 +- .../Cache/TransformTreeFixture.cs | 11 +- .../Cache/TransformTreeWithRefreshFixture.cs | 11 +- .../Cache/TransformWithInlineUpdateFixture.cs | 11 +- .../Cache/TrueForAllFixture.cs | 10 +- .../Cache/TrueForAnyFixture.cs | 12 +- src/DynamicData.Tests/Cache/WatchFixture.cs | 9 +- src/DynamicData.Tests/Cache/WatcherFixture.cs | 13 - src/DynamicData.Tests/Cache/XorFixture.cs | 11 +- src/DynamicData.Tests/Domain/Animal.cs | 8 +- src/DynamicData.Tests/Domain/AnimalOwner.cs | 8 +- src/DynamicData.Tests/Domain/Fakers.cs | 7 +- src/DynamicData.Tests/Domain/Market.cs | 12 +- src/DynamicData.Tests/Domain/MarketPrice.cs | 8 +- .../Domain/ParentAndChildren.cs | 6 +- src/DynamicData.Tests/Domain/Person.cs | 7 +- src/DynamicData.Tests/Domain/PersonObs.cs | 6 +- .../Domain/PersonWithChildren.cs | 5 +- .../Domain/PersonWithEmployment.cs | 4 +- .../Domain/PersonWithFriends.cs | 7 +- .../Domain/PersonWithGender.cs | 4 +- .../Domain/PersonWithRelations.cs | 5 +- .../Domain/RandomPersonGenerator.cs | 6 +- .../Domain/SelfObservingPerson.cs | 5 +- .../DynamicData.Tests.csproj | 45 +- src/DynamicData.Tests/EnumerableExFixtures.cs | 10 +- .../EnumerableIListFixture.cs | 11 +- .../IntegrationTestFixtureBase.cs | 4 +- .../Internal/BitsetFixture.cs | 6 +- .../CacheParentSubscriptionFixture.cs | 18 +- .../Internal/DeliveryQueueFixture.cs | 15 +- .../Internal/KeyedDisposableFixture.cs | 9 +- .../Internal/NotificationFixture.cs | 9 +- .../Internal/SharedDeliveryQueueFixture.cs | 15 +- .../Internal/SwappableLockFixture.cs | 7 +- .../Issues/EmptyToChangeSetIssue.cs | 8 +- .../Issues/OnItemRemovedIssue.cs | 9 +- .../Kernal/CacheUpdaterFixture.cs | 11 +- .../Kernal/DistinctUpdateFixture.cs | 11 +- src/DynamicData.Tests/Kernal/EnumerableEx.cs | 5 +- .../Kernal/KeyValueFixture.cs | 10 +- src/DynamicData.Tests/Kernal/OptionFixture.cs | 11 +- .../Kernal/OptionObservableFixture.cs | 12 +- .../Kernal/SourceUpdaterFixture.cs | 11 +- src/DynamicData.Tests/Kernal/UpdateFixture.cs | 11 +- src/DynamicData.Tests/List/AndFixture.cs | 10 +- .../List/AutoRefreshFixture.cs | 15 +- src/DynamicData.Tests/List/BatchFixture.cs | 13 +- src/DynamicData.Tests/List/BatchIfFixture.cs | 14 +- .../List/BatchIfWithTimeOutFixture.cs | 13 +- src/DynamicData.Tests/List/BufferFixture.cs | 13 +- .../List/BufferInitialFixture.cs | 14 +- src/DynamicData.Tests/List/CastFixture.cs | 9 +- .../List/ChangeAwareListFixture.cs | 11 +- .../List/ChangeSetFixture.cs | 19 +- .../List/CloneChangesFixture.cs | 12 +- src/DynamicData.Tests/List/CloneFixture.cs | 13 +- .../List/CreationFixtures.cs | 10 +- .../List/DeferUntilLoadedFixture.cs | 11 +- .../List/DisposeManyFixture.cs | 12 +- .../List/DistinctValuesFixture.cs | 11 +- .../List/DynamicAndFixture.cs | 9 +- .../List/DynamicExceptFixture.cs | 9 +- .../List/DynamicOrFixture.cs | 9 +- .../List/DynamicXOrFixture.cs | 9 +- src/DynamicData.Tests/List/EditDiffFixture.cs | 11 +- src/DynamicData.Tests/List/ExceptFixture.cs | 10 +- .../List/ExpireAfterFixture.cs | 22 +- ...terControllerFixtureWithClearAndReplace.cs | 12 +- .../FilterControllerFixtureWithDiffSet.cs | 12 +- .../List/FilterFixture.Base.cs | 25 +- .../List/FilterFixture.Static.cs | 42 +- .../List/FilterFixture.WithPredicateState.cs | 49 +- .../List/FilterOnObservableFixture.cs | 12 +- .../List/FilterOnPropertyFixture.cs | 11 +- .../List/FilterWithObservable.cs | 12 +- .../List/ForEachChangeFixture.cs | 12 +- .../List/FromAsyncFixture.cs | 16 +- .../List/GroupImmutableFixture.cs | 14 +- src/DynamicData.Tests/List/GroupOnFixture.cs | 11 +- .../List/GroupOnPropertyFixture.cs | 12 +- ...roupOnPropertyWithImmutableStateFixture.cs | 12 +- .../List/MergeChangeSetsFixture.cs | 19 +- .../List/MergeManyChangeSetsCacheFixture.cs | 19 +- .../List/MergeManyChangeSetsFixture.cs | 9 +- .../List/MergeManyChangeSetsListFixture.cs | 17 +- .../List/MergeManyFixture.cs | 10 +- .../List/OnItemAddedFixture.cs | 20 +- .../List/OnItemRefreshedFixture.cs | 20 +- .../List/OnItemRemovedFixture.cs | 23 +- src/DynamicData.Tests/List/OrFixture.cs | 10 +- src/DynamicData.Tests/List/PageFixture.cs | 16 +- .../List/QueryWhenChangedFixture.cs | 10 +- .../List/RecursiveTransformManyFixture.cs | 11 +- src/DynamicData.Tests/List/RefCountFixture.cs | 13 +- .../List/RemoveManyFixture.cs | 10 +- src/DynamicData.Tests/List/ReverseFixture.cs | 9 +- src/DynamicData.Tests/List/SelectFixture.cs | 10 +- .../List/SizeLimitFixture.cs | 13 +- src/DynamicData.Tests/List/SortFixture.cs | 16 +- .../List/SortMutableFixture.cs | 16 +- .../List/SortPrimitiveFixture.cs | 12 +- .../List/SourceListFixture.cs | 9 +- .../List/SourceListPreviewFixture.cs | 7 +- .../List/SubscribeManyFixture.cs | 10 +- src/DynamicData.Tests/List/SwitchFixture.cs | 10 +- .../List/ToCollectionFixture.cs | 8 +- ...ChangeSetFixture.Items.IntegrationTests.cs | 13 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 32 +- ...geSetFixture.Sequences.IntegrationTests.cs | 13 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 31 +- .../List/ToObservableChangeSetFixture.cs | 4 +- .../List/TransformAsyncFixture.cs | 11 +- .../List/TransformFixture.cs | 11 +- .../List/TransformManyFixture.cs | 13 +- ...ransformManyObservableCollectionFixture.cs | 12 +- .../List/TransformManyProjectionFixture.cs | 13 +- .../List/TransformManyRefreshFixture.cs | 12 +- .../List/VirtualisationFixture.cs | 14 +- src/DynamicData.Tests/List/XOrFixture.cs | 10 +- .../ObservableCollectionExFixture.cs | 12 +- .../Utilities/CacheChangeSetAssertions.cs | 7 +- .../Utilities/CacheItemRecordingObserver.cs | 5 +- .../CacheItemRecordingObserverAssertions.cs | 4 +- .../Utilities/ComparerExtensions.cs | 8 +- .../Utilities/FakeScheduler.cs | 7 +- .../Utilities/FakerExtensions.cs | 8 +- .../Utilities/FunctionalExtensions.cs | 4 +- .../Utilities/ListChangeSetAssertions.cs | 7 +- .../Utilities/ListItemRecordingObserver.cs | 5 +- .../Utilities/ObservableEx.cs | 6 +- .../Utilities/ObservableExtensions.cs | 23 +- .../Utilities/ObservableSpy.cs | 10 +- .../Utilities/RandomizerExtensions.cs | 7 +- .../Utilities/RawAnonymousObservable.cs | 4 +- .../Utilities/RawAnonymousObserver.cs | 4 +- .../Utilities/RecordingObserverBase.cs | 14 +- .../Utilities/SelectManyExtensions.cs | 6 +- .../Utilities/StressAddRemoveExtensions.cs | 7 +- .../Utilities/TestSourceCache.cs | 10 +- .../Utilities/TestSourceList.cs | 9 +- .../UnsynchronizedNotificationException.cs | 9 +- .../Utilities/ValueRecordingObserver.cs | 5 +- .../Aggregation/AggregateEnumerator.cs | 6 +- src/DynamicData/Aggregation/AggregationEx.cs | 5 +- src/DynamicData/Aggregation/AvgEx.cs | 4 +- src/DynamicData/Aggregation/CountEx.cs | 2 - src/DynamicData/Aggregation/MaxEx.cs | 2 - src/DynamicData/Aggregation/StdDevEx.cs | 2 - src/DynamicData/Alias/ObservableCacheAlias.cs | 2 - src/DynamicData/Attributes.cs | 4 +- .../Binding/AbstractNotifyPropertyChanged.cs | 7 +- src/DynamicData/Binding/BindPaged.cs | 5 - src/DynamicData/Binding/BindVirtualized.cs | 5 - src/DynamicData/Binding/BindingListAdaptor.cs | 4 - .../Binding/BindingListEventsSuspender.cs | 4 - src/DynamicData/Binding/BindingListEx.cs | 6 - src/DynamicData/Binding/ExpressionBuilder.cs | 6 - .../Binding/IObservableCollection.cs | 5 +- src/DynamicData/Binding/IObservableListEx.cs | 3 - .../Binding/NotifyPropertyChangedEx.cs | 6 +- src/DynamicData/Binding/Observable.cs | 2 - .../Binding/ObservableCollectionAdaptor.cs | 6 +- .../Binding/ObservableCollectionEx.cs | 7 +- .../Binding/ObservableCollectionExtended.cs | 7 +- .../Binding/ObservablePropertyFactory.cs | 9 - .../Binding/ObservablePropertyFactoryCache.cs | 6 +- .../Binding/ObservablePropertyPart.cs | 6 +- src/DynamicData/Binding/SortAndBind.cs | 7 - src/DynamicData/Binding/SortAndBindOptions.cs | 2 - .../Binding/SortedBindingListAdaptor.cs | 2 - src/DynamicData/Cache/ChangeAwareCache.cs | 2 - src/DynamicData/Cache/IPagedChangeSet.cs | 2 - src/DynamicData/Cache/IntermediateCache.cs | 5 +- .../Internal/AnonymousObservableCache.cs | 5 +- .../Cache/Internal/AsyncDisposeMany.cs | 7 +- src/DynamicData/Cache/Internal/AutoRefresh.cs | 4 - src/DynamicData/Cache/Internal/BatchIf.cs | 5 - src/DynamicData/Cache/Internal/Cache.cs | 2 - src/DynamicData/Cache/Internal/Cast.cs | 2 - .../Cache/Internal/ChangeSetCache.cs | 2 - src/DynamicData/Cache/Internal/Combiner.cs | 4 +- .../Cache/Internal/DeferUntilLoaded.cs | 4 +- src/DynamicData/Cache/Internal/DisposeMany.cs | 4 - .../Cache/Internal/DistinctCalculator.cs | 2 - .../Cache/Internal/DynamicCombiner.cs | 3 - .../Cache/Internal/DynamicGrouper.cs | 3 - .../Internal/EditDiffChangeSetOptional.cs | 2 - .../Cache/Internal/ExpireAfter.ForSource.cs | 6 - .../Cache/Internal/ExpireAfter.ForStream.cs | 6 - .../Cache/Internal/Filter.Dynamic.cs | 4 - .../Cache/Internal/Filter.Static.cs | 2 - .../Cache/Internal/FilterImmutable.cs | 3 - .../Cache/Internal/FilterOnObservable.cs | 3 - src/DynamicData/Cache/Internal/FinallySafe.cs | 5 +- src/DynamicData/Cache/Internal/FullJoin.cs | 3 - src/DynamicData/Cache/Internal/GroupOn.cs | 4 - .../Cache/Internal/GroupOnDynamic.cs | 4 - .../Cache/Internal/GroupOnImmutable.cs | 4 - .../Cache/Internal/GroupOnObservable.cs | 3 - .../Cache/Internal/GroupOnProperty.cs | 5 - .../GroupOnPropertyWithImmutableState.cs | 5 - .../Cache/Internal/IndexAndNode.cs | 2 - src/DynamicData/Cache/Internal/InnerJoin.cs | 3 - src/DynamicData/Cache/Internal/KeySelector.cs | 4 +- .../Cache/Internal/KeyValueCollection.cs | 4 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 3 - .../Cache/Internal/LockFreeObservableCache.cs | 5 - .../Cache/Internal/MergeChangeSets.cs | 4 - src/DynamicData/Cache/Internal/MergeMany.cs | 4 - .../Internal/MergeManyCacheChangeSets.cs | 5 +- .../MergeManyCacheChangeSetsSourceCompare.cs | 5 +- .../Cache/Internal/MergeManyItems.cs | 4 +- .../Cache/Internal/MergeManyListChangeSets.cs | 6 +- .../Cache/Internal/ObservableWithValue.cs | 4 +- src/DynamicData/Cache/Internal/OfType.cs | 3 - .../Cache/Internal/OnBeingRemoved.cs | 3 - src/DynamicData/Cache/Internal/Page.cs | 3 - .../Cache/Internal/QueryWhenChanged.cs | 3 - src/DynamicData/Cache/Internal/RefCount.cs | 3 - .../Cache/Internal/RemoveKeyEnumerator.cs | 2 - src/DynamicData/Cache/Internal/RightJoin.cs | 3 - src/DynamicData/Cache/Internal/SizeExpirer.cs | 5 +- src/DynamicData/Cache/Internal/Sort.cs | 4 - src/DynamicData/Cache/Internal/SortAndPage.cs | 4 - .../Cache/Internal/SortAndVirtualize.cs | 4 - .../Cache/Internal/SortExtensions.cs | 2 - .../Internal/SortedKeyValueApplicator.cs | 2 - .../Cache/Internal/SpecifiedGrouper.cs | 3 - .../Cache/Internal/StatusMonitor.cs | 6 +- .../Cache/Internal/SubscribeMany.cs | 4 - src/DynamicData/Cache/Internal/Switch.cs | 4 - .../Cache/Internal/ToObservableChangeSet.cs | 6 - .../Cache/Internal/ToObservableOptional.cs | 2 - src/DynamicData/Cache/Internal/Transform.cs | 4 +- .../Cache/Internal/TransformAsync.cs | 4 - .../Cache/Internal/TransformImmutable.cs | 3 - .../Cache/Internal/TransformMany.cs | 7 - .../Cache/Internal/TransformManyAsync.cs | 3 - .../Cache/Internal/TransformOnObservable.cs | 3 - .../Internal/TransformWithForcedTransform.cs | 3 - .../Internal/TransformWithInlineUpdate.cs | 4 +- src/DynamicData/Cache/Internal/TreeBuilder.cs | 5 - src/DynamicData/Cache/Internal/TrueFor.cs | 5 +- .../Cache/Internal/UniquenessEnforcer.cs | 2 - src/DynamicData/Cache/Internal/Virtualise.cs | 3 - src/DynamicData/Cache/Node.cs | 4 +- src/DynamicData/Cache/ObservableCache.cs | 11 +- .../Cache/ObservableCacheEx.Adapt.cs | 14 - .../Cache/ObservableCacheEx.AdaptSelector.cs | 16 +- .../Cache/ObservableCacheEx.AddOrUpdate.cs | 14 - .../Cache/ObservableCacheEx.And.cs | 14 - .../ObservableCacheEx.AsObservableCache.cs | 14 - .../ObservableCacheEx.AsyncDisposeMany.cs | 14 - .../Cache/ObservableCacheEx.AutoRefresh.cs | 14 - ...servableCacheEx.AutoRefreshOnObservable.cs | 14 - .../Cache/ObservableCacheEx.Batch.cs | 14 - .../Cache/ObservableCacheEx.BatchIf.cs | 14 - .../Cache/ObservableCacheEx.Bind.cs | 14 - .../Cache/ObservableCacheEx.BufferInitial.cs | 14 - .../Cache/ObservableCacheEx.Cast.cs | 14 - .../Cache/ObservableCacheEx.ChangeKey.cs | 14 - .../Cache/ObservableCacheEx.Clear.cs | 14 - .../Cache/ObservableCacheEx.Clone.cs | 14 - .../Cache/ObservableCacheEx.Combine.cs | 16 +- .../Cache/ObservableCacheEx.Convert.cs | 14 - ...vableCacheEx.CreateChangeSetTransformer.cs | 16 +- .../ObservableCacheEx.DeferUntilLoaded.cs | 14 - .../Cache/ObservableCacheEx.DisposeMany.cs | 14 - .../Cache/ObservableCacheEx.DistinctValues.cs | 14 - .../Cache/ObservableCacheEx.EditDiff.cs | 14 - .../ObservableCacheEx.EnsureUniqueKeys.cs | 14 - .../Cache/ObservableCacheEx.Except.cs | 14 - .../Cache/ObservableCacheEx.ExpireAfter.cs | 14 - .../Cache/ObservableCacheEx.Filter.cs | 14 - .../ObservableCacheEx.FilterImmutable.cs | 14 - .../ObservableCacheEx.FilterOnObservable.cs | 14 - .../Cache/ObservableCacheEx.FinallySafe.cs | 14 - .../Cache/ObservableCacheEx.Flatten.cs | 14 - .../ObservableCacheEx.FlattenBufferResult.cs | 14 - .../Cache/ObservableCacheEx.ForEachChange.cs | 14 - .../Cache/ObservableCacheEx.ForForced.cs | 16 +- .../Cache/ObservableCacheEx.FullJoin.cs | 14 - .../Cache/ObservableCacheEx.FullJoinMany.cs | 14 - .../Cache/ObservableCacheEx.Group.cs | 14 - .../ObservableCacheEx.GroupOnObservable.cs | 14 - .../ObservableCacheEx.GroupOnProperty.cs | 14 - ...cheEx.GroupOnPropertyWithImmutableState.cs | 14 - ...servableCacheEx.GroupWithImmutableState.cs | 14 - ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 14 - .../ObservableCacheEx.IgnoreUpdateWhen.cs | 14 - .../ObservableCacheEx.IncludeUpdateWhen.cs | 14 - .../Cache/ObservableCacheEx.InnerJoin.cs | 14 - .../Cache/ObservableCacheEx.InnerJoinMany.cs | 14 - .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 14 - .../Cache/ObservableCacheEx.LeftJoin.cs | 14 - .../Cache/ObservableCacheEx.LeftJoinMany.cs | 14 - .../Cache/ObservableCacheEx.LimitSizeTo.cs | 14 - .../ObservableCacheEx.MergeChangeSets.cs | 14 - .../Cache/ObservableCacheEx.MergeMany.cs | 14 - .../ObservableCacheEx.MergeManyChangeSets.cs | 14 - .../Cache/ObservableCacheEx.MergeManyItems.cs | 14 - .../Cache/ObservableCacheEx.MonitorStatus.cs | 14 - .../Cache/ObservableCacheEx.NotEmpty.cs | 14 - .../Cache/ObservableCacheEx.OfType.cs | 14 - .../Cache/ObservableCacheEx.OnChangeAction.cs | 16 +- .../Cache/ObservableCacheEx.OnItemAdded.cs | 14 - .../ObservableCacheEx.OnItemRefreshed.cs | 14 - .../Cache/ObservableCacheEx.OnItemRemoved.cs | 14 - .../Cache/ObservableCacheEx.OnItemUpdated.cs | 14 - src/DynamicData/Cache/ObservableCacheEx.Or.cs | 14 - .../Cache/ObservableCacheEx.PopulateFrom.cs | 14 - .../Cache/ObservableCacheEx.PopulateInto.cs | 14 - .../ObservableCacheEx.QueryWhenChanged.cs | 14 - .../Cache/ObservableCacheEx.RefCount.cs | 14 - .../Cache/ObservableCacheEx.Refresh.cs | 14 - .../Cache/ObservableCacheEx.Remove.cs | 14 - .../Cache/ObservableCacheEx.RemoveKey.cs | 14 - .../Cache/ObservableCacheEx.RemoveKeys.cs | 14 - .../Cache/ObservableCacheEx.RightJoin.cs | 14 - .../Cache/ObservableCacheEx.RightJoinMany.cs | 14 - .../Cache/ObservableCacheEx.SkipInitial.cs | 14 - .../Cache/ObservableCacheEx.Sort.cs | 14 - .../Cache/ObservableCacheEx.SortAndBind.cs | 6 +- .../Cache/ObservableCacheEx.SortBy.cs | 14 - .../Cache/ObservableCacheEx.StartWithEmpty.cs | 14 - .../Cache/ObservableCacheEx.StartWithItem.cs | 14 - .../Cache/ObservableCacheEx.SubscribeMany.cs | 14 - .../ObservableCacheEx.SuppressRefresh.cs | 14 - .../Cache/ObservableCacheEx.Switch.cs | 14 - .../Cache/ObservableCacheEx.ToCollection.cs | 14 - ...ObservableCacheEx.ToObservableChangeSet.cs | 14 - .../ObservableCacheEx.ToObservableOptional.cs | 14 - .../ObservableCacheEx.ToSortedCollection.cs | 14 - .../Cache/ObservableCacheEx.Transform.cs | 14 - .../Cache/ObservableCacheEx.TransformAsync.cs | 14 - .../ObservableCacheEx.TransformImmutable.cs | 14 - .../Cache/ObservableCacheEx.TransformMany.cs | 14 - .../ObservableCacheEx.TransformManyAsync.cs | 14 - ...bservableCacheEx.TransformManySafeAsync.cs | 14 - ...ObservableCacheEx.TransformOnObservable.cs | 14 - .../Cache/ObservableCacheEx.TransformSafe.cs | 14 - .../ObservableCacheEx.TransformSafeAsync.cs | 14 - .../ObservableCacheEx.TransformToTree.cs | 14 - ...rvableCacheEx.TransformWithInlineUpdate.cs | 14 - ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 14 - .../Cache/ObservableCacheEx.TrueFor.cs | 16 +- .../Cache/ObservableCacheEx.TrueForAll.cs | 14 - .../Cache/ObservableCacheEx.TrueForAny.cs | 14 - .../Cache/ObservableCacheEx.UpdateIndex.cs | 14 - .../ObservableCacheEx.VirtualiseAndPage.cs | 5 +- .../Cache/ObservableCacheEx.Watch.cs | 14 - .../Cache/ObservableCacheEx.WatchValue.cs | 14 - ...bservableCacheEx.WhenAnyPropertyChanged.cs | 14 - .../ObservableCacheEx.WhenPropertyChanged.cs | 14 - .../ObservableCacheEx.WhenValueChanged.cs | 14 - .../ObservableCacheEx.WhereReasonsAre.cs | 14 - .../ObservableCacheEx.WhereReasonsAreNot.cs | 14 - .../Cache/ObservableCacheEx.Xor.cs | 14 - src/DynamicData/Cache/ObservableCacheEx.cs | 14 - src/DynamicData/Cache/PageContext.cs | 2 - src/DynamicData/Cache/PageResponse.cs | 4 +- src/DynamicData/Cache/PagedChangeSet.cs | 5 +- src/DynamicData/Cache/SortAndPageOptions.cs | 2 - .../Cache/SortAndVirtualizeOptions.cs | 2 - src/DynamicData/Cache/SortedChangeSet.cs | 4 +- src/DynamicData/Cache/SourceCache.cs | 5 +- .../Cache/Tests/ChangeSetAggregator.cs | 7 +- .../Tests/DistinctChangeSetAggregator.cs | 7 +- .../Cache/Tests/GroupChangeSetAggregator.cs | 5 - .../Cache/Tests/PagedChangeSetAggregator.cs | 7 +- .../Cache/Tests/SortedChangeSetAggregator.cs | 7 +- .../Cache/Tests/VirtualChangeSetAggregator.cs | 7 +- src/DynamicData/Cache/VirtualChangeSet.cs | 2 - .../Diagnostics/DiagnosticOperators.cs | 2 - src/DynamicData/DynamicData.csproj | 28 +- src/DynamicData/DynamicDataOptions.cs | 2 - src/DynamicData/EnumerableEx.cs | 3 - .../Experimental/ExperimentalEx.cs | 2 - .../Experimental/ISubjectWithRefCount.cs | 2 - .../Experimental/SubjectWithRefCount.cs | 3 - src/DynamicData/Experimental/Watcher.cs | 5 - src/DynamicData/GlobalConfig.cs | 2 - src/DynamicData/Internal/Bitset.cs | 4 +- .../Internal/CacheParentSubscription.cs | 4 - src/DynamicData/Internal/Notification.cs | 2 - src/DynamicData/Internal/ObservableEx.cs | 2 - src/DynamicData/Internal/Rxx.cs | 1 - .../Internal/SharedDeliveryQueue.cs | 4 +- .../Internal/SynchronizeSafeExtensions.cs | 3 - src/DynamicData/Kernel/EnumerableIList.cs | 3 - src/DynamicData/Kernel/EnumeratorIList.cs | 2 - src/DynamicData/Kernel/InternalEx.cs | 5 - .../Kernel/OptionObservableExtensions.cs | 2 - src/DynamicData/Kernel/Optional.cs | 2 - .../Kernel/ReadOnlyCollectionLight.cs | 4 +- src/DynamicData/List/ChangeAwareList.cs | 2 - .../List/ChangeAwareListWithRefCounts.cs | 2 - src/DynamicData/List/ChangeSetEx.cs | 5 +- src/DynamicData/List/IPageChangeSet.cs | 4 +- .../List/Internal/AnonymousObservableList.cs | 5 +- src/DynamicData/List/Internal/AutoRefresh.cs | 4 - src/DynamicData/List/Internal/BufferIf.cs | 7 +- .../List/Internal/ClonedListChangeSet.cs | 2 - src/DynamicData/List/Internal/Combiner.cs | 5 - .../List/Internal/DeferUntilLoaded.cs | 4 +- src/DynamicData/List/Internal/DisposeMany.cs | 4 - src/DynamicData/List/Internal/Distinct.cs | 4 +- .../List/Internal/DynamicCombiner.cs | 7 +- src/DynamicData/List/Internal/ExpireAfter.cs | 8 +- .../List/Internal/Filter.Dynamic.cs | 4 +- .../List/Internal/Filter.Static.cs | 2 - .../Internal/Filter.WithPredicateState.cs | 4 - .../List/Internal/FilterOnObservable.cs | 4 - .../List/Internal/FilterOnProperty.cs | 4 - src/DynamicData/List/Internal/FilterStatic.cs | 4 +- src/DynamicData/List/Internal/GroupOn.cs | 6 +- .../List/Internal/GroupOnImmutable.cs | 6 +- .../List/Internal/GroupOnProperty.cs | 5 - .../GroupOnPropertyWithImmutableState.cs | 5 - src/DynamicData/List/Internal/LimitSizeTo.cs | 5 +- .../List/Internal/MergeChangeSets.cs | 5 +- src/DynamicData/List/Internal/MergeMany.cs | 6 +- .../List/Internal/MergeManyCacheChangeSets.cs | 7 +- .../List/Internal/MergeManyListChangeSets.cs | 4 - src/DynamicData/List/Internal/OnItemAdded.cs | 4 +- .../List/Internal/OnItemRefreshed.cs | 4 +- .../List/Internal/OnItemRemoved.cs | 4 +- src/DynamicData/List/Internal/Pager.cs | 5 +- .../List/Internal/QueryWhenChanged.cs | 4 +- src/DynamicData/List/Internal/RefCount.cs | 3 - src/DynamicData/List/Internal/Sort.cs | 3 - .../List/Internal/SubscribeMany.cs | 6 +- src/DynamicData/List/Internal/Switch.cs | 3 - .../List/Internal/ToObservableChangeSet.cs | 6 - .../List/Internal/TransformAsync.cs | 4 +- .../List/Internal/TransformMany.cs | 9 +- src/DynamicData/List/Internal/Transformer.cs | 4 +- src/DynamicData/List/Internal/Virtualiser.cs | 2 - src/DynamicData/List/Linq/AddKeyEnumerator.cs | 4 +- .../List/Linq/ItemChangeEnumerator.cs | 4 +- .../List/Linq/UnifiedChangeEnumerator.cs | 6 +- .../List/Linq/WithoutIndexEnumerator.cs | 4 +- src/DynamicData/List/ListEx.cs | 2 - .../List/ObservableListEx.Adapt.cs | 13 - .../List/ObservableListEx.AddKey.cs | 13 - src/DynamicData/List/ObservableListEx.And.cs | 13 - .../List/ObservableListEx.AsObservableList.cs | 13 - .../List/ObservableListEx.AutoRefresh.cs | 13 - ...bservableListEx.AutoRefreshOnObservable.cs | 13 - src/DynamicData/List/ObservableListEx.Bind.cs | 13 - .../List/ObservableListEx.BufferIf.cs | 13 - .../List/ObservableListEx.BufferInitial.cs | 13 - src/DynamicData/List/ObservableListEx.Cast.cs | 13 - .../List/ObservableListEx.CastToObject.cs | 13 - .../List/ObservableListEx.Clone.cs | 13 - .../List/ObservableListEx.Combine.cs | 15 +- .../List/ObservableListEx.Convert.cs | 13 - .../List/ObservableListEx.DeferUntilLoaded.cs | 13 - .../List/ObservableListEx.DisposeMany.cs | 13 - .../List/ObservableListEx.DistinctValues.cs | 13 - .../List/ObservableListEx.Except.cs | 13 - .../List/ObservableListEx.ExpireAfter.cs | 13 - .../List/ObservableListEx.Filter.cs | 13 - .../ObservableListEx.FilterOnObservable.cs | 13 - .../List/ObservableListEx.FilterOnProperty.cs | 13 - .../ObservableListEx.FlattenBufferResult.cs | 13 - .../List/ObservableListEx.ForEachChange.cs | 13 - .../ObservableListEx.ForEachItemChange.cs | 13 - .../List/ObservableListEx.GroupOn.cs | 13 - .../List/ObservableListEx.GroupOnProperty.cs | 13 - ...istEx.GroupOnPropertyWithImmutableState.cs | 13 - ...bservableListEx.GroupWithImmutableState.cs | 13 - .../List/ObservableListEx.LimitSizeTo.cs | 13 - .../List/ObservableListEx.MergeChangeSets.cs | 13 - .../List/ObservableListEx.MergeMany.cs | 13 - .../ObservableListEx.MergeManyChangeSets.cs | 13 - .../List/ObservableListEx.NotEmpty.cs | 13 - .../List/ObservableListEx.OnItemAdded.cs | 13 - .../List/ObservableListEx.OnItemRefreshed.cs | 13 - .../List/ObservableListEx.OnItemRemoved.cs | 13 - src/DynamicData/List/ObservableListEx.Or.cs | 13 - src/DynamicData/List/ObservableListEx.Page.cs | 13 - .../List/ObservableListEx.PopulateInto.cs | 13 - .../List/ObservableListEx.QueryWhenChanged.cs | 13 - .../List/ObservableListEx.RefCount.cs | 13 - .../List/ObservableListEx.RemoveIndex.cs | 13 - .../List/ObservableListEx.Reverse.cs | 13 - .../List/ObservableListEx.SkipInitial.cs | 13 - src/DynamicData/List/ObservableListEx.Sort.cs | 13 - .../List/ObservableListEx.StartWithEmpty.cs | 13 - .../List/ObservableListEx.SubscribeMany.cs | 13 - .../List/ObservableListEx.SuppressRefresh.cs | 13 - .../List/ObservableListEx.Switch.cs | 13 - .../List/ObservableListEx.ToCollection.cs | 13 - .../ObservableListEx.ToObservableChangeSet.cs | 13 - .../ObservableListEx.ToSortedCollection.cs | 13 - src/DynamicData/List/ObservableListEx.Top.cs | 13 - .../List/ObservableListEx.Transform.cs | 13 - .../List/ObservableListEx.TransformAsync.cs | 13 - .../List/ObservableListEx.TransformMany.cs | 13 - .../List/ObservableListEx.Virtualise.cs | 13 - ...ObservableListEx.WhenAnyPropertyChanged.cs | 13 - .../ObservableListEx.WhenPropertyChanged.cs | 13 - .../List/ObservableListEx.WhenValueChanged.cs | 13 - .../List/ObservableListEx.WhereReasonsAre.cs | 13 - .../ObservableListEx.WhereReasonsAreNot.cs | 13 - src/DynamicData/List/ObservableListEx.Xor.cs | 13 - src/DynamicData/List/ObservableListEx.cs | 13 - src/DynamicData/List/PageChangeSet.cs | 6 +- src/DynamicData/List/RangeChange.cs | 4 +- src/DynamicData/List/SourceList.cs | 9 +- .../List/SourceListEditConvenienceEx.cs | 4 +- .../List/Tests/ChangeSetAggregator.cs | 5 +- src/DynamicData/List/VirtualChangeSet.cs | 4 +- src/DynamicData/ObservableChangeSet.cs | 3 - src/DynamicData/Platforms/net45/PFilter.cs | 5 +- .../Platforms/net45/PSubscribeMany.cs | 4 +- src/DynamicData/Platforms/net45/PTransform.cs | 3 +- .../Polyfills/RequiredMemberAttribute.cs | 1 - 694 files changed, 739 insertions(+), 7273 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs index f5e397006..a20921ec2 100644 --- a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs +++ b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs @@ -1,17 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using BenchmarkDotNet.Attributes; - -using DynamicData.Binding; - namespace DynamicData.Benchmarks.Cache; /// diff --git a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs index 1e4f83e65..fc1b34c15 100644 --- a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; - -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache { [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/EditDiff.cs b/src/DynamicData.Benchmarks/Cache/EditDiff.cs index a6b4fd53d..81c3d0dc7 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using BenchmarkDotNet.Attributes; - -using DynamicData.Kernel; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs index 3c437f89f..cad902d57 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index a13cefbf0..09a58d931 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 6bde5da17..c34bc974f 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 0404b7c54..baa3bab76 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] @@ -99,7 +90,6 @@ public Filter_Cache_WithPredicateState() } _changeSets = changeSets.MoveToImmutable(); - var predicateStates = ImmutableArray.CreateBuilder(initialCapacity: 5_000); while (predicateStates.Count < predicateStates.Capacity) predicateStates.Add(randomizer.Int()); diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 484e544e1..de6afeac3 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; -using BenchmarkDotNet.Attributes; -using DynamicData.Binding; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] @@ -19,7 +11,6 @@ private record Item(string Name, int Id, int Ranking); .Ascending(i => i.Ranking) .ThenByAscending(i => i.Name); - Subject> _newSubject = new(); Subject> _newSubjectOptimised = new(); Subject> _oldSubject = new(); @@ -32,12 +23,9 @@ private record Item(string Name, int Id, int Ranking); private ReadOnlyObservableCollection? _oldList; private ReadOnlyObservableCollection? _oldListOptimised; - - [Params(10, 100, 1_000, 10_000, 50_000)] public int Count { get; set; } - [GlobalSetup] public void SetUp() { @@ -46,7 +34,6 @@ public void SetUp() _newSubject = new Subject>(); _newSubjectOptimised = new Subject>(); - _cleanUp = new CompositeDisposable ( _newSubject.SortAndBind(out var newList, _comparer).Subscribe(), @@ -65,8 +52,6 @@ public void SetUp() _oldList = oldList; _oldListOptimised = oldOptimisedList; - - var changeSet = new ChangeSet(Count); foreach (var i in Enumerable.Range(1, Count)) { @@ -84,7 +69,6 @@ public void SetUp() [Benchmark(Baseline = true)] public void Old() => RunTest(_oldSubject, _oldList!); - [Benchmark] public void OldOptimized() => RunTest(_oldSubjectOptimised, _oldListOptimised!); @@ -94,7 +78,6 @@ public void SetUp() [Benchmark] public void NewOptimized() => RunTest(_newSubjectOptimised, _newListOptimised!); - void RunTest(Subject> subject, ReadOnlyObservableCollection list) { var original = list[Count / 2]; @@ -106,6 +89,5 @@ void RunTest(Subject> subject, ReadOnlyObservableCollectio }); } - public void Dispose() => _cleanUp?.Dispose(); -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index a27b082bd..645831d9f 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,11 +1,4 @@ -using BenchmarkDotNet.Attributes; -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; -using DynamicData.Binding; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] @@ -17,7 +10,6 @@ private record Item(string Name, int Id, int Ranking); private readonly SortExpressionComparer _comparer = SortExpressionComparer.Ascending(i => i.Ranking).ThenByAscending(i => i.Name); - Subject> _newSubject = new(); Subject> _newSubjectOptimised = new(); Subject> _oldSubject = new(); @@ -26,11 +18,9 @@ private record Item(string Name, int Id, int Ranking); private IDisposable? _cleanUp; private ChangeSet? _changeSet; - [Params(10, 100, 1_000, 10_000, 50_000)] public int Count { get; set; } - [GlobalSetup] public void SetUp() { @@ -63,7 +53,6 @@ public void SetUp() ); } - [Benchmark(Baseline = true)] public void Old() => _oldSubject.OnNext(_changeSet!); @@ -76,6 +65,5 @@ public void SetUp() [Benchmark] public void NewOptimized() => _newSubjectOptimised.OnNext(_changeSet!); - public void Dispose() => _cleanUp?.Dispose(); -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/Cache/SourceCache.cs b/src/DynamicData.Benchmarks/Cache/SourceCache.cs index f2157221d..567f88803 100644 --- a/src/DynamicData.Benchmarks/Cache/SourceCache.cs +++ b/src/DynamicData.Benchmarks/Cache/SourceCache.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Linq; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.Cache { public class BenchmarkItem diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index b4a806afb..5766288ff 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 9328dd956..33b029399 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index eca407d03..61949a4ca 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index 3bbd28d8f..072b6e05c 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/TransformMany.cs b/src/DynamicData.Benchmarks/Cache/TransformMany.cs index 5b91eaa41..a2e9fc723 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformMany.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformMany.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 451ac4697..e0679ad1d 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -5,9 +5,28 @@ net9.0 AnyCPU false + enable ;1591;1701;1702;1705;CA1822;CA1001 + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs index 53cbe5d5e..8f0d698e1 100644 --- a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs +++ b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Reactive.Disposables; - -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.List { [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs index ec9a39316..d5930adaf 100644 --- a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs +++ b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 6e4ab39ee..439f45160 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; -using System.Reflection; -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index e9065ef17..3f3a30eec 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; -using System.Reflection; -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 3707767be..dde27a14d 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/GroupAdd.cs b/src/DynamicData.Benchmarks/List/GroupAdd.cs index 92572496e..0037925eb 100644 --- a/src/DynamicData.Benchmarks/List/GroupAdd.cs +++ b/src/DynamicData.Benchmarks/List/GroupAdd.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/GroupRemove.cs b/src/DynamicData.Benchmarks/List/GroupRemove.cs index d4ba95e05..f6fb98f1a 100644 --- a/src/DynamicData.Benchmarks/List/GroupRemove.cs +++ b/src/DynamicData.Benchmarks/List/GroupRemove.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] @@ -53,4 +47,4 @@ public void Teardown() [Benchmark] public void Clear() => _sourceList?.Clear(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/List/SourceList.cs b/src/DynamicData.Benchmarks/List/SourceList.cs index 6556d6ecf..5fa5c3975 100644 --- a/src/DynamicData.Benchmarks/List/SourceList.cs +++ b/src/DynamicData.Benchmarks/List/SourceList.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Linq; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] @@ -39,4 +34,4 @@ public void SetupIteration() [Benchmark] public void Insert() => _sourceList?.InsertRange(_items!, 0); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index 0908c20f9..30437c289 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,10 +1,4 @@ -using System; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs b/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs index 14566ea3c..7456b3949 100644 --- a/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs +++ b/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; - namespace System.Runtime.CompilerServices; // Allows use of the C#11 `required` keyword, internally within this library, when targeting frameworks older than .NET 7. diff --git a/src/DynamicData.Benchmarks/Program.cs b/src/DynamicData.Benchmarks/Program.cs index 5bf5d888f..d21a9bfdf 100644 --- a/src/DynamicData.Benchmarks/Program.cs +++ b/src/DynamicData.Benchmarks/Program.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.IO; -using System.Runtime.CompilerServices; - -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Running; - namespace DynamicData.Benchmarks { public static class Program @@ -23,4 +17,4 @@ public static void Main(string[] args) private static string GetProjectRootDirectory([CallerFilePath] string? callerFilePath = null) => Path.GetDirectoryName(callerFilePath)!; } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.cs b/src/DynamicData.Tests/API/ApiApprovalTests.cs index 4799b73eb..716ce9d16 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.cs +++ b/src/DynamicData.Tests/API/ApiApprovalTests.cs @@ -1,8 +1,4 @@ -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Xunit; - -namespace DynamicData.APITests +namespace DynamicData.APITests { /// /// Tests for handling API approval. diff --git a/src/DynamicData.Tests/API/ApiExtensions.cs b/src/DynamicData.Tests/API/ApiExtensions.cs index cd465eb86..26fb54740 100644 --- a/src/DynamicData.Tests/API/ApiExtensions.cs +++ b/src/DynamicData.Tests/API/ApiExtensions.cs @@ -1,12 +1,4 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; -using PublicApiGenerator; -using VerifyXunit; - -namespace DynamicData.APITests; +namespace DynamicData.APITests; /// /// A helper for doing API approvals. diff --git a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs index 4755cddbc..926f3472f 100644 --- a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Reactive.Linq; - -using DynamicData.Aggregation; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs index 400461a92..8ea8854ff 100644 --- a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs @@ -1,11 +1,4 @@ -using System; - -using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs index 89f274619..b8a0dac5c 100644 --- a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs @@ -1,11 +1,4 @@ -using System; - -using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/MinFixture.cs b/src/DynamicData.Tests/AggregationTests/MinFixture.cs index 168babdbd..6c3e72aea 100644 --- a/src/DynamicData.Tests/AggregationTests/MinFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MinFixture.cs @@ -1,11 +1,4 @@ -using System; - -using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs index 078a8f1b0..5b538f582 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Aggregation; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs index 9e9108602..5df9402a9 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Aggregation; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index 94226edb9..3a644aad8 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class AutoRefreshFilter { @@ -32,7 +21,6 @@ public void Bind_Transform_and_FilterOnObservable() ); } - [Fact] public void Test() { diff --git a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs index 478fa6807..fe52ad12a 100644 --- a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs +++ b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class AvaloniaDictionaryFixture { @@ -51,7 +38,6 @@ public void Replace() _results.Data.Items[0].Should().Be(person2); } - [Fact] public void Remove() { @@ -64,7 +50,6 @@ public void Remove() } } - public interface IAvaloniaDictionary : IDictionary, IAvaloniaReadOnlyDictionary, @@ -73,7 +58,6 @@ public interface IAvaloniaDictionary { } - public interface IAvaloniaReadOnlyDictionary : IReadOnlyDictionary, INotifyCollectionChanged, @@ -82,7 +66,6 @@ public interface IAvaloniaReadOnlyDictionary { } - /* Copied from Avalionia because an issue was raised due to compatibility issues with ToObservableChangeSet(). @@ -202,7 +185,6 @@ public void Clear() PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Count))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(CommonPropertyNames.IndexerName)); - if (CollectionChanged != null) { var e = new NotifyCollectionChangedEventArgs( @@ -294,7 +276,6 @@ private void NotifyAdd(TKey key, TValue value) PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Count))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs($"{CommonPropertyNames.IndexerName}[{key}]")); - if (CollectionChanged != null) { var e = new NotifyCollectionChangedEventArgs( diff --git a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs index 750aaf1ae..a9625365e 100644 --- a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs @@ -1,14 +1,4 @@ -#if SUPPORTS_BINDINGLIST - -using System; -using System.ComponentModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +#if SUPPORTS_BINDINGLIST namespace DynamicData.Tests.Binding { @@ -61,8 +51,6 @@ public void Clear() _collection.Count.Should().Be(0, "Should be 100 items in the collection"); } - - [Fact] public void Refresh() { @@ -83,7 +71,6 @@ public void Refresh() args.NewIndex.Should().Be(10); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs index f76ff68bf..712beebc0 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs @@ -1,15 +1,5 @@ #if SUPPORTS_BINDINGLIST -using System; -using System.ComponentModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Binding { public class BindingListCacheFixture : IDisposable @@ -57,7 +47,6 @@ public void BatchRemove() _collection.Count.Should().Be(0, "Should be 100 items in the collection"); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs index a706c4aea..b59b03a75 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs @@ -1,16 +1,4 @@ -#if SUPPORTS_BINDINGLIST - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +#if SUPPORTS_BINDINGLIST namespace DynamicData.Tests.Binding { @@ -70,7 +58,6 @@ public void CollectionIsInSortOrder() sorted.Should().BeEquivalentTo(_collection.ToList()); } - [Fact] public void LargeUpdateInvokesAReset() { @@ -109,7 +96,6 @@ public void Refresh() _collection[args.NewIndex].Should().Be(people[10]); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { @@ -197,7 +183,6 @@ public void UpdateToSourceUpdatesTheDestination() _collection.First().Should().Be(personUpdated, "Should be updated person"); } - public void Dispose() { _binder.Dispose(); @@ -205,6 +190,5 @@ public void Dispose() } } - } #endif diff --git a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs index b9818d8bc..87921e1a3 100644 --- a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.ComponentModel; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class BindingListToChangeSetFixture : IDisposable { @@ -80,7 +70,6 @@ public void RefreshCausesReplace() sourceCacheResults.Messages.First().Adds.Should().Be(1); sourceCacheResults.Messages.Last().Refreshes.Should().Be(1); - /* List receives add and replace instead of refresh (and as of 23/02/2023 it receives a refresh too!) */ @@ -130,7 +119,6 @@ public void ResetFiresClearsAndAdds() resetNotification.Adds.Should().Be(10); } - [Fact] public void InsertInto() { diff --git a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs index e233c5c6a..6db977ac6 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class DeeplyNestedNotifyPropertyChangedFixture { diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs index 2c01a256d..8303bf4f7 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class IObservableListBindCacheFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs index 35aa4eb1f..73ed1ae88 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class IObservableListBindCacheSortedFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs index 9dceabfb2..0314d324b 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class IObservableListBindListFixture : IDisposable { @@ -43,7 +31,6 @@ public void ResetThresholdsForBinding_ObservableCollection() var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -65,7 +52,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Bind(list).Subscribe() : _source.Connect().Bind(list, options.Value).Subscribe(); @@ -82,14 +68,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -122,8 +106,6 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() } } - - [Fact] public void AddRange() { diff --git a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs index 2de2402f2..8aaa7af1f 100644 --- a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs +++ b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class NotifyPropertyChangedExFixture { diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs index 6d68b12c0..6c28856bb 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ObservableCollectionBindCacheFixture : IDisposable { @@ -34,15 +21,12 @@ public void ResetThresholdsForBinding_ObservableCollection() { var people = _generator.Take(100).ToArray(); - - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -64,7 +48,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Bind(list).Subscribe() : _source.Connect().Bind(list, options.Value).Subscribe(); @@ -81,14 +64,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -121,7 +102,6 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() } } - [Fact] public void AddToSourceAddsToDestination() { @@ -173,7 +153,6 @@ public void UpdateToSourceSendsReplaceOnDestination() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { var collection = new ObservableCollectionExtended(); @@ -181,7 +160,6 @@ void RunTest(bool useReplace) using var source = new SourceCache(p => p.Name); using var binder = source.Connect().Bind(collection, new ObservableCollectionAdaptor(useReplaceForUpdates: useReplace)).Subscribe(); - NotifyCollectionChangedAction action = default; source.AddOrUpdate(new Person("Adult1", 50)); diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs index c5df8ce24..837a1b632 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ObservableCollectionBindCacheSortedFixture : IDisposable { @@ -32,21 +19,17 @@ public ObservableCollectionBindCacheSortedFixture() _binder = _source.Connect().Sort(_comparer, resetThreshold: 25).Bind(_collection).Subscribe(); } - [Fact] public void ResetThresholdsForBinding_ObservableCollection() { var people = _generator.Take(100).ToArray(); - - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -68,7 +51,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Sort(_comparer).Bind(list).Subscribe() : _source.Connect().Sort(_comparer).Bind(list, options.Value).Subscribe(); @@ -85,14 +67,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -292,7 +272,6 @@ public void UpdateToSourceSendsReplaceIfSortingIsNotAffected() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { var collection = new ObservableCollectionExtended(); diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs index 8e71766e3..6d4cb5f83 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ObservableCollectionBindListFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs index a3d89a0d1..a26eefa4f 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ObservableCollectionExtendedToChangeSetFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs index da7252cef..0ea6e0d3c 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ObservableCollectionToChangeSetFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs index 13efc2a87..79457734d 100644 --- a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ReadOnlyObservableCollectionToChangeSetFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs index 492448b73..3fbc2abbf 100644 --- a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ReadonlyCollectionBindCacheFixture : IDisposable { @@ -74,7 +64,6 @@ public void UpdateToSourceSendsReplaceOnDestination() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { using var source = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs index 48a60e35d..6eaf8f1a9 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.ComponentModel; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Binding; /// diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 5c8d073c8..d3213b587 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -2,23 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Binding; /// @@ -315,10 +298,10 @@ public async Task AutoRefreshThenFilter_ConcurrentAddsAndPropertyActivation_AllI await Task.WhenAll(adder, flipper).WaitAsync(ConditionTimeout); - var expected = items.Select(x => x.Id).ToHashSet(); - WaitForCondition(() => results.Data.Keys.ToHashSet().SetEquals(expected)); + var expected = Enumerable.ToHashSet(items.Select(x => x.Id)); + WaitForCondition(() => Enumerable.ToHashSet(results.Data.Keys).SetEquals(expected)); - var actual = results.Data.Keys.ToHashSet(); + var actual = Enumerable.ToHashSet(results.Data.Keys); actual.Should().BeEquivalentTo(expected, $"iter {iter}: every item ends Activated=true and must appear in the filter (missing: {string.Join(",", expected.Except(actual))})"); results.Error.Should().BeNull($"iter {iter}: pipeline must not error"); } @@ -365,10 +348,10 @@ public async Task AutoRefreshThenFilter_DualSubscribers_AllItemsObserved() foreach (var item in items) cache.AddOrUpdate(item); - var expected = items.Select(x => x.Id).ToHashSet(); - WaitForCondition(() => results.Data.Keys.ToHashSet().SetEquals(expected)); + var expected = Enumerable.ToHashSet(items.Select(x => x.Id)); + WaitForCondition(() => Enumerable.ToHashSet(results.Data.Keys).SetEquals(expected)); - var actual = results.Data.Keys.ToHashSet(); + var actual = Enumerable.ToHashSet(results.Data.Keys); actual.Should().BeEquivalentTo(expected, $"iter {iter}: every item was flipped to Activated=true by the mutator and must appear in the filter (missing: {string.Join(",", expected.Except(actual))})"); results.Error.Should().BeNull($"iter {iter}: pipeline must not error"); } diff --git a/src/DynamicData.Tests/Cache/AndFixture.cs b/src/DynamicData.Tests/Cache/AndFixture.cs index 0f0ec2ad0..959495cb3 100644 --- a/src/DynamicData.Tests/Cache/AndFixture.cs +++ b/src/DynamicData.Tests/Cache/AndFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class AndFixture : AndFixtureBase { diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 3fe7de711..7b7f237fa 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -1,18 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture { @@ -44,7 +30,6 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -61,7 +46,6 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp disposalsCompletedResults.RecordedValues.Should().BeEmpty("no disposals should have occurred"); disposalsCompletedResults.HasCompleted.Should().BeFalse("no disposals should have occurred"); - var error = new Exception("Test"); source.Items.ElementAt(1).FailDisposal(error); @@ -104,7 +88,6 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -121,7 +104,6 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - sourceCompletionSource.OnNext(Unit.Default); foreach (var item in source.Items) item.CompleteDisposal(); @@ -161,7 +143,6 @@ public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - var items = Enumerable.Range(1, 100_000) .Select(id => new AsyncDisposableItem() { @@ -181,7 +162,6 @@ public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - sourceCompletionSource.OnNext(); await Task.WhenAll(items .GroupBy(item => item.Id % 4) diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index c6eea36b0..a6e10cdc3 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Cache.Internal; -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture { @@ -42,7 +27,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - // Addition var items = new List() { @@ -72,7 +56,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - // Movement items.Move(2, 0, items[2]); items.Move(2, 1, items[2]); @@ -96,7 +79,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - // Refreshing source.OnNext(new ChangeSet(items .Select((item, index) => new Change( @@ -150,7 +132,6 @@ public void ItemsAreRemoved_ItemsAreDisposedAfterDownstreamProcessing(ItemType i disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -167,7 +148,6 @@ public void ItemsAreRemoved_ItemsAreDisposedAfterDownstreamProcessing(ItemType i disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - var items = source.Items.ToArray(); source.Clear(); @@ -213,7 +193,6 @@ public void ItemsAreUpdated_PreviousItemsAreDisposedAfterDownstreamProcessing(It disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -230,7 +209,6 @@ public void ItemsAreUpdated_PreviousItemsAreDisposedAfterDownstreamProcessing(It disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - var previousItems = source.Items.ToArray(); source.AddOrUpdate(new[] { @@ -278,7 +256,6 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s ? Observable.Return(changeSet) : new Subject>(); - ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source @@ -293,7 +270,6 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) { subject.OnNext(changeSet); @@ -334,7 +310,6 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp .Concat(Observable.Throw>(error)) : new Subject>(); - ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source @@ -349,7 +324,6 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) { subject.OnNext(changeSet); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs index 38da53d5d..959042438 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs @@ -1,7 +1,4 @@ -using System; -using System.Threading.Tasks; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index ebdc26950..d83c73af5 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture { @@ -31,7 +18,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -46,7 +32,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -54,7 +39,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(1).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); @@ -62,7 +46,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -74,7 +57,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item1.Value; @@ -82,7 +64,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); @@ -90,7 +71,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification) ++item3.Value; @@ -98,7 +78,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -110,7 +89,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (normal refresh) source.Refresh(item2); @@ -140,7 +118,6 @@ public void ItemIsAdded_SubscribesToPropertyChanged() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -192,7 +169,6 @@ public void ItemIsMoved_NotificationPropagates() "item indexes should propagate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -226,7 +202,6 @@ public void ItemIsRefreshed_NotificationPropagates() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -262,7 +237,6 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -274,7 +248,6 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(item2); @@ -300,7 +273,6 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -312,7 +284,6 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 2 }; source.AddOrUpdate(item4); @@ -340,7 +311,6 @@ public void PropertyChangedOccurs_ItemRefreshes() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -352,7 +322,6 @@ public void PropertyChangedOccurs_ItemRefreshes() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.Value; @@ -379,7 +348,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -394,7 +362,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -402,7 +369,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(1).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification, immediately) ++item2.Value; @@ -410,7 +376,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(1).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -422,7 +387,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -430,7 +394,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification, within throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); ++item2.Value; @@ -440,7 +403,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of original throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -448,7 +410,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window should have been extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(25).Ticks); @@ -469,7 +430,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -501,7 +461,6 @@ public void SourceCompletesWhenNotEmpty_CompletionDoesNotPropagate(NotificationS source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -536,7 +495,6 @@ public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrateg var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -582,7 +540,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - // UUT Initialization using var subscription = BuildUut(source.Prepend(initialChangeset)) .ValidateSynchronization() @@ -594,7 +551,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs index c948aedb8..b81fb7a2a 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture { @@ -36,7 +25,6 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -48,7 +36,6 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.OtherValue; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs index 402d175ff..04ba1f275 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture { @@ -26,7 +17,6 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -38,7 +28,6 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action item2.RaiseAllPropertiesChanged(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs index be5b936a3..e0422d6f7 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index a09e0ea9c..a663cd9e1 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -1,18 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture { @@ -32,7 +18,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -48,7 +33,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish reevaluator notification) ++item2.Value; @@ -56,7 +40,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(1).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); @@ -64,7 +47,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -76,7 +58,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish reevaluator notification) ++item1.Value; @@ -84,7 +65,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); @@ -92,7 +72,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional reevaluator notification) ++item3.Value; @@ -100,7 +79,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -112,7 +90,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (normal refresh) source.Refresh(item2); @@ -136,7 +113,6 @@ public void ItemIsAdded_SubscribesToReevaluator() using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -149,7 +125,6 @@ public void ItemIsAdded_SubscribesToReevaluator() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddOrUpdate(new[] { item1, item2, item3 }); @@ -199,7 +174,6 @@ public void ItemIsMoved_NotificationPropagates() "item indexes should propagate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -235,7 +209,6 @@ public void ItemIsRefreshed_NotificationPropagates() var reevaluatorInvocationCount = 0; - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -281,7 +254,6 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -295,7 +267,6 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(item2); @@ -321,7 +292,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -335,7 +305,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action using var item4 = new Item() { Id = 2 }; source.AddOrUpdate(item4); @@ -350,7 +319,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() item1.HasObservers.Should().BeTrue("the item was not removed from the source"); item3.HasObservers.Should().BeTrue("the item was not removed from the source"); - // UUT Action (updated item publishes reevaluator notification) ++item4.Value; @@ -377,7 +345,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (initial completion) if (notificationStrategy is NotificationStrategy.Immediate) item2.Complete(); @@ -397,7 +364,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (remaining reevaluator completions) item1.Complete(); item3.Complete(); @@ -406,7 +372,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (source completion) source.Complete(); @@ -427,7 +392,6 @@ public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCom source.AddOrUpdate(item); - // UUT Initialization & Action (reevaluator completion) if (notificationStrategy is NotificationStrategy.Immediate) item.Complete(); @@ -447,7 +411,6 @@ public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCom results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (source completion) source.Complete(); @@ -468,7 +431,6 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -482,7 +444,6 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.Value; @@ -507,7 +468,6 @@ public void ReevaluatorEmitsImmediately_ItemDoesNotRefresh() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action using var subscription = BuildUut( source: source.Connect(), @@ -539,7 +499,6 @@ public void ReevaluatorFails_ErrorPropagates(NotificationStrategy notificationSt var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) item2.SetError(error); @@ -572,7 +531,6 @@ public void ReevaluatorThrows_ExceptionPropagates() var error = new Exception("Test"); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -585,7 +543,6 @@ public void ReevaluatorThrows_ExceptionPropagates() results.RecordedChangeSets.Should().BeEmpty("no initial changesets were published"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action using var item = new Item() { Id = 1 }; source.AddOrUpdate(item); @@ -602,7 +559,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -636,7 +592,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -656,7 +611,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (initial reevaluator completion) item2.Complete(); @@ -664,7 +618,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (remaining reevaluator completions) item1.Complete(); item3.Complete(); @@ -690,7 +643,6 @@ public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrateg var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -740,7 +692,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - // UUT Initialization using var subscription = BuildUut( source: source.Prepend(initialChangeset), @@ -754,7 +705,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs index 4fa7ec9d7..0518bd2f0 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs index 3e96d6e96..e5f5eeab3 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index 4e6f974a2..a0b546e80 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture { diff --git a/src/DynamicData.Tests/Cache/BatchFixture.cs b/src/DynamicData.Tests/Cache/BatchFixture.cs index d22e060fe..1fbd0dba8 100644 --- a/src/DynamicData.Tests/Cache/BatchFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchFixture.cs @@ -1,14 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class BatchFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index d88bd2f03..22e446b03 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class BatchIfFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 239dba558..12c766a1a 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class BatchIfWithTimeoutFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs index eafe1bf6e..5ccc89cc8 100644 --- a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class BufferInitialFixture { diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index 8915bc6bc..1ed1373b7 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -2,26 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Reactive.Threading.Tasks; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; - -using DynamicData.Binding; -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; /// @@ -797,8 +777,6 @@ static int CountAll(IEnumerable> nodes) treeCache.Items.Any(n => n.Children.Count > 0).Should().BeTrue("Tree has child nodes"); treeCache2.Count.Should().BeGreaterThan(0, "Tree2 produces results"); - - // Side chains lastQuery.Should().NotBeNull("QueryWhenChanged(B) fired"); lastQueryA.Should().NotBeNull("QueryWhenChanged(A) fired"); diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index 4f4ddf9a4..260606a67 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -1,19 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; /// diff --git a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs index 1e19ba079..2cfb11840 100644 --- a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DeferAnsdSkipFixture { diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index b196e1431..a9dd01fb9 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class DisposeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/DistinctFixture.cs b/src/DynamicData.Tests/Cache/DistinctFixture.cs index fbbd36c7b..e714beffc 100644 --- a/src/DynamicData.Tests/Cache/DistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/DistinctFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DistinctFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs index c9b79b545..c958bd8b0 100644 --- a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DynamicAndFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs index 43a993e46..ccb28a4d6 100644 --- a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DynamicExceptFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs index d02c37649..33aa6dbac 100644 --- a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DynamicOrFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs index e2e70119a..fdfe728e9 100644 --- a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class DynamicXorFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs index d178c9ea6..4bd1cd078 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EditDiffChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 280f7db33..8b8809269 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Kernel; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EditDiffChangeSetOptionalFixture { diff --git a/src/DynamicData.Tests/Cache/EditDiffFixture.cs b/src/DynamicData.Tests/Cache/EditDiffFixture.cs index da98c9aa0..8dfd360d2 100644 --- a/src/DynamicData.Tests/Cache/EditDiffFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EditDiffFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs index fe2d05737..76ea1186b 100644 --- a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs +++ b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Mono.Cecil; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EnsureUniqueKeysFixture: IDisposable { @@ -18,7 +11,6 @@ public EnsureUniqueKeysFixture() _results = _source.Connect(suppressEmptyChangeSets: false).EnsureUniqueKeys().AsAggregator(); } - [Fact] public void UniqueForAdds() { @@ -67,7 +59,6 @@ public void Refresh() } - [Fact] public void CompoundRefresh1() { @@ -122,7 +113,6 @@ public void CompoundRefresh3() } - public void Dispose() { _source.Dispose(); diff --git a/src/DynamicData.Tests/Cache/ExceptFixture.cs b/src/DynamicData.Tests/Cache/ExceptFixture.cs index 17c4996e8..1bae2dfd1 100644 --- a/src/DynamicData.Tests/Cache/ExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/ExceptFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ExceptFixture : ExceptFixtureBase { diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index ad88ee3a8..f55431f24 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture { @@ -188,7 +173,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() // Not testing Move changes, since ISourceCache doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -326,7 +310,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() // Not testing Move changes, since ISourceCache doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -411,7 +394,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() var item1 = new TestItem() { Id = 1, Expiration = DateTimeOffset.FromUnixTimeMilliseconds(10) }; source.AddOrUpdate(item1); - results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); source.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index 868fad2fd..189a84466 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -1,20 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture { @@ -287,7 +271,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() new(reason: ChangeReason.Moved, key: item1.Id, current: item1, previous: default, currentIndex: 4, previousIndex: 1) }); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(7, "8 source operations were performed, and 1 should have been ignored"); @@ -453,7 +436,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() new(reason: ChangeReason.Moved, key: item1.Id, current: item1, previous: default, currentIndex: 4, previousIndex: 1) }); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(7, "8 source operations were performed, and 1 should have been ignored"); @@ -592,7 +574,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() new(reason: ChangeReason.Add, key: item1.Id, current: item1) }); - results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs index f701d6a38..92c5be14b 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Reactive.Concurrency; - -using Microsoft.Reactive.Testing; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs index dad57e373..0e5230b90 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -32,7 +22,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -47,7 +36,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -63,7 +51,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -76,7 +63,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -90,7 +76,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddOrUpdate(new[] { @@ -107,7 +92,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -147,7 +131,6 @@ public void ItemsAreMoved_MovementsAreIgnored(EmptyChangesetPolicy emptyChangese results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -167,7 +150,6 @@ public void ItemsAreMoved_MovementsAreIgnored(EmptyChangesetPolicy emptyChangese } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -190,7 +172,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -205,7 +186,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -218,7 +198,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -231,7 +210,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -254,7 +232,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges new Item() { Id = 6, IsIncluded = false } }); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -269,7 +246,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and update items) source.AddOrUpdate(new[] { @@ -286,7 +262,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and update items) source.AddOrUpdate(new[] { @@ -303,7 +278,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -326,7 +300,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -341,7 +314,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(source.Items.Where(Item.FilterByIsIncluded).ToArray()); @@ -350,7 +322,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty results.RecordedItemsByKey.Values.Should().BeEmpty("all matching items were removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index 8b5c76e4c..e63d2bc4f 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -39,7 +27,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var source = new Subject>(); using var predicateChanged = new Subject>(); - // UUT Initialization using var subscription = source .Filter(predicateChanged) @@ -47,7 +34,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -67,7 +53,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(finalPredicate), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index 5315727d1..09562f121 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -26,7 +15,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -40,7 +28,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -87,7 +74,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -111,7 +97,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -126,7 +111,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateChanged.OnNext(Item.FilterByEvenId); @@ -135,7 +119,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByEvenId), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -164,7 +147,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC var reapplyFilter = new Subject(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter(predicateChanged) @@ -183,7 +165,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action source.Complete(); @@ -194,7 +175,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -215,7 +195,6 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm ? new Subject>() : Observable.Empty>(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -250,7 +229,6 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS ? new Subject>() : Observable.Throw>(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -311,7 +289,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -336,7 +313,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -355,7 +331,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action predicateChanged.OnCompleted(); @@ -364,7 +339,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final Verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -376,7 +350,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var source = new Subject>(); using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - // UUT Initialization using var subscription = source .Filter(predicateChanged) @@ -388,7 +361,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 8491fe821..7bb4b9832 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -41,7 +28,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var predicateChanged = new Subject>(); using var reapplyFilter = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -51,7 +37,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -76,7 +61,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(finalPredicate), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index e56101cb5..70b517dbc 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -26,7 +15,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -41,7 +29,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -84,7 +71,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedItemsByKey.Should().BeEmpty("the predicate has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -108,7 +94,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -124,7 +109,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateChanged.OnNext(Item.FilterByEvenId); @@ -133,7 +117,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByEvenId), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -166,7 +149,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA var reapplyFilter = new Subject(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -187,7 +169,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.ReapplyFilter) source.Complete(); @@ -201,7 +182,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("changes could still be generated by the filtering sources"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.ReapplyFilter) reapplyFilter.OnCompleted(); @@ -215,7 +195,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -236,7 +215,6 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm ? new Subject>() : Observable.Empty>(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -272,7 +250,6 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS ? new Subject>() : Observable.Throw>(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -326,7 +303,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo ? new Subject() : Observable.Empty(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -344,7 +320,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.PredicateChanged) source.Complete(); @@ -355,7 +330,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("changes could still be generated by other source streams"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.PredicateChanged) predicateChanged.OnCompleted(); @@ -366,7 +340,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all input streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -385,7 +358,6 @@ public void ReapplyFilterFails_ErrorPropagates(CompletionStrategy completionStra ? new Subject() : Observable.Throw(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -432,7 +404,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha var predicate = Item.FilterByIsIncluded; - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -448,7 +419,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(predicate), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Items[1].IsIncluded = false; source.Items[5].IsIncluded = true; @@ -460,7 +430,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(predicate), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -477,7 +446,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -503,7 +471,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -533,7 +500,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); using var reapplyFilter = new Subject(); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -554,7 +520,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.PredicateChanged) reapplyFilter.OnCompleted(); @@ -566,7 +531,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeFalse("the collection could still change due to outstanding source streams"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.PredicateChanged) predicateChanged.OnCompleted(); @@ -578,7 +542,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -591,7 +554,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); using var reapplyFilter = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -605,7 +567,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index 49654ba16..c4c21028d 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -37,7 +26,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var source = new Subject>(); using var predicateState = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -47,7 +35,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -67,7 +54,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(item => Item.FilterByIdInclusionMask(finalPredicateState, item)), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index 1b0c55c88..f9f42d81b 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -25,7 +15,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source .Connect() @@ -41,7 +30,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -84,7 +72,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt results.RecordedItemsByKey.Should().BeEmpty("the predicate has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -120,7 +107,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom ? new Subject() : Observable.Return(new object()); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -141,7 +127,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action source.Complete(); @@ -152,7 +137,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -173,7 +157,6 @@ public void PredicateStateCompletesBeforeInitialValue_CompletionPropagatesIfEmpt ? new Subject() : Observable.Empty(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -209,7 +192,6 @@ public void PredicateStateFails_ErrorPropagates(CompletionStrategy completionStr ? new Subject() : Observable.Throw(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -254,7 +236,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -270,7 +251,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(item => Item.FilterByIdInclusionMask(predicateState.Value, item)), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateState.OnNext(0xA); @@ -279,7 +259,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(item => Item.FilterByIdInclusionMask(predicateState.Value, item)), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -296,7 +275,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -322,7 +300,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -347,7 +324,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple using var predicateState = new BehaviorSubject(new object()); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -368,7 +344,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action predicateState.OnCompleted(); @@ -377,7 +352,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -389,7 +363,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var source = new Subject>(); using var predicateState = new BehaviorSubject(new()); - // UUT Initialization using var subscription = source .Filter( @@ -403,7 +376,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs index 1ca4de0cd..4b9f9a7f7 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -1,16 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; -using DynamicData.Tests.Domain; -using System.Collections.ObjectModel; -using System.Linq; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -33,7 +21,6 @@ public void SourceCompletes_CompletionPropagates(CompletionStrategy completionSt // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -51,7 +38,6 @@ public void SourceCompletes_CompletionPropagates(CompletionStrategy completionSt results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("the source has completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -62,7 +48,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() // Setup using var source = new Subject>(); - // UUT Intialization using var subscription = source .Filter(Item.FilterByIsIncluded) @@ -75,7 +60,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEmpty("the source has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.cs b/src/DynamicData.Tests/Cache/FilterFixture.cs index d42e11579..a7b26b644 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.cs @@ -1,10 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using Bogus; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index 5abf88761..c5fa83e7f 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class FilterImmutableFixture { @@ -23,7 +12,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - // Add items var item1 = new Item() { Id = 1, IsIncluded = true }; var item2 = new Item() { Id = 2, IsIncluded = false }; @@ -37,7 +25,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "2 items were added, with 1 excluded"); - // Replace items, changing inclusion var item3 = new Item() { Id = item1.Id, IsIncluded = false }; var item4 = new Item() { Id = item2.Id, IsIncluded = true }; @@ -51,7 +38,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4 }, "2 items were replaced, with 1 excluded"); - // Replace items, not changing inclusion var item5 = new Item() { Id = item3.Id, IsIncluded = false }; var item6 = new Item() { Id = item4.Id, IsIncluded = true }; @@ -65,7 +51,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item6 }, "2 items were replaced, with 1 excluded"); - // Refresh items source.OnNext(new ChangeSet() { @@ -77,7 +62,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item6 }, "2 items were refreshed, with 1 excluded"); - // Remove items source.OnNext(new ChangeSet() { @@ -89,7 +73,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.RecordedChangeSets.Skip(4).Count().Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Should().BeEmpty("2 items were removed, with one excluded"); - results.RecordedChangeSets.SelectMany(static changes => changes).Should().AllSatisfy( change => { @@ -122,7 +105,6 @@ public void ItemsAreMoved_ChangesAreNotPropagated() }); var changeSetsBeforeMove = results.RecordedChangeSets.Count; - // Move items source.OnNext(new ChangeSet() { @@ -153,7 +135,6 @@ public void PredicateThrows_ExceptionIsCaptured() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -175,7 +156,6 @@ public void SourceCompletes_CompletionIsPropagated() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -188,7 +168,6 @@ public void SourceCompletes_CompletionIsPropagated() results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, IsIncluded = true }; source.OnNext(new ChangeSet() @@ -221,7 +200,6 @@ public void SourceCompletesImmediately_CompletionIsPropagated() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - results.Error.Should().BeNull(); results.HasCompleted.Should().BeTrue(); results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); @@ -240,7 +218,6 @@ public void SourceErrors_ErrorIsPropagated() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -253,7 +230,6 @@ public void SourceErrors_ErrorIsPropagated() results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, IsIncluded = true }; source.OnNext(new ChangeSet() @@ -287,7 +263,6 @@ public void SourceErrorsImmediately_ErrorIsPropagated() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - results.Error.Should().Be(error); results.HasCompleted.Should().BeFalse(); results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); @@ -313,7 +288,6 @@ public void SuppressEmptyChangesetsIsFalse_EmptyChangesetsArePublished() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - ManipulateExcludedItems(source); results.Error.Should().BeNull(); @@ -332,7 +306,6 @@ public void SuppressEmptyChangesetsIsTrue_EmptyChangesetsAreNotPublished() .ValidateChangeSets(Item.KeySelector) .RecordCacheItems(out var results); - ManipulateExcludedItems(source); results.Error.Should().BeNull(); diff --git a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs index 7ed96e287..197c6395b 100644 --- a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs @@ -1,8 +1,4 @@ -using System.Linq; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; /// /// See https://github.com/reactivemarbles/DynamicData/issues/400 diff --git a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs index 84b487055..55b9f7e2e 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Microsoft.Reactive.Testing; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; /// /// Test Fixture for the FilterOnObservable extension method. diff --git a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs index bc1411684..02362136b 100644 --- a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.PLinq; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.PLinq; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs index 1da5de03a..4191db500 100644 --- a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ForEachChangeFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index 03f716d6d..c504b7389 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class FromAsyncFixture { diff --git a/src/DynamicData.Tests/Cache/FullJoinFixture.cs b/src/DynamicData.Tests/Cache/FullJoinFixture.cs index e290edcf1..78e56b571 100644 --- a/src/DynamicData.Tests/Cache/FullJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class FullJoinFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs index 0a0c99c29..da4f1087a 100644 --- a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class FullJoinManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index 31686cadd..5c121e796 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupControllerFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs index 871f5498c..78d7116ee 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupControllerForFilteredItemsFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupFixture.cs b/src/DynamicData.Tests/Cache/GroupFixture.cs index c0139eed5..93f9ceb78 100644 --- a/src/DynamicData.Tests/Cache/GroupFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs index b5f3292dc..0bcb75dc9 100644 --- a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupFromDistinctFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs index 8640bccb7..fa334d1f9 100644 --- a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupImmutableFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs index ab5fd0bd4..939b35ff7 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -1,19 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -using Person = DynamicData.Tests.Domain.Person; - + namespace DynamicData.Tests.Cache; public class GroupOnDynamicFixture : IDisposable @@ -264,7 +249,6 @@ public void ResultIsCorrectAfterForcedRegroup() VerifyGroupingResults(); } - [Theory] [InlineData(false, false, false)] [InlineData(false, false, true)] diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index 1909b2abb..a946eec36 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -1,19 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -using Person = DynamicData.Tests.Domain.Person; - + namespace DynamicData.Tests.Cache; public class GroupOnObservableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs index 7af362118..fe524c117 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupOnPropertyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs index 2321b6e3c..3b016228c 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupOnPropertyWithImmutableStateFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs index 7223a17af..9f31af216 100644 --- a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class IgnoreUpdateFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs index 5895a7e71..49e160c37 100644 --- a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class IncludeUpdateFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs index bd5ffc054..8cde6f517 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class InnerJoinFixture : IDisposable { @@ -124,7 +116,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -132,7 +123,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -140,7 +130,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(2); _result.Data.Keys.Should().NotContain(pair => pair.rightKey == 2); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -148,7 +137,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -231,28 +219,24 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); _result.Data.Count.Should().Be(2); _result.Data.Keys.Should().NotContain(pair => pair.rightKey == 2); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index bdad60ee9..4e9dc3b3d 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -1,10 +1,4 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class InnerJoinFixtureRaceCondition { diff --git a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs index edaad944a..e441e1df7 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class InnerJoinManyFixture : IDisposable { @@ -87,7 +77,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -96,7 +85,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -104,7 +92,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(1); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -112,7 +99,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(2); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -193,7 +179,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -201,21 +186,18 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); _result.Data.Count.Should().Be(1); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); _result.Data.Count.Should().Be(2); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs b/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs index d8f46418e..a6f65caa3 100644 --- a/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs +++ b/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static class KeyValueCollectionEx { diff --git a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs index c5d0fcd35..3ada67a1c 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class LeftJoinFixture : IDisposable { @@ -134,7 +124,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -143,7 +132,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -151,7 +139,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(pair => pair.Key == 2); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -159,7 +146,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -238,7 +224,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); @@ -246,21 +231,18 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(pair => pair.Key == 2); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs index dd4b22056..0900008c6 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class LeftJoinManyFixture : IDisposable { @@ -90,7 +80,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -99,7 +88,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -107,7 +95,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -115,7 +102,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -196,7 +182,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -204,21 +189,18 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs index b6f3047e2..398870a04 100644 --- a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed partial class MergeChangeSetsFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index 949ec35bf..b0493f63b 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -1,21 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class MergeManyChangeSetsCacheFixture : IDisposable { @@ -816,7 +799,6 @@ public void MergeManyChangeSetsWorksCorrectlyWithValueTypes() results.Summary.Overall.Removes.Should().Be(PricesPerMarket); } - [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs index ce6cc89fd..ab2e4b271 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs @@ -1,21 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class MergeManyChangeSetsCacheSourceCompareFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs index 49f566907..3c474a032 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class MergeManyChangeSetsListFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index 553bf452e..d8d504d6a 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class MergeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs index e2a6be748..112e80e6b 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class MergeManyItemsFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs index e6987e846..1f4362150 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class MergeManyWithKeyOverloadFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs index 6a6a33a38..e6958b706 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class MonitorStatusFixture { diff --git a/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs b/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs index 801b03040..f9a734fe3 100644 --- a/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ObservableCachePreviewFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 4460dad3e..7cfd02bc3 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ObservableChangeSetFixture { @@ -27,7 +13,6 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() //the aim of this test is to ensure we can continuously receive subscriptions when we use the async subscribe overloads var result = new List(); - var observable = ObservableChangeSet.Create( async (changeSet, token) => { @@ -49,11 +34,9 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() i => i) .Select(cs => cs.Select(c => c.Current).ToList()); - var isComplete = false; Exception? error = null; - //load list of results var subscriber = observable .Subscribe(item => result.AddRange(item), ex => error = ex, () => isComplete = true); @@ -77,7 +60,6 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() subscriber.Dispose(); } - [Fact] public void HandlesAsyncError() { diff --git a/src/DynamicData.Tests/Cache/OfTypeFixture.cs b/src/DynamicData.Tests/Cache/OfTypeFixture.cs index ec38a0629..d0f9ca57d 100644 --- a/src/DynamicData.Tests/Cache/OfTypeFixture.cs +++ b/src/DynamicData.Tests/Cache/OfTypeFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Bogus; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class OfTypeFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/OnItemFixture.cs b/src/DynamicData.Tests/Cache/OnItemFixture.cs index 97aeebc75..c04a68c0e 100644 --- a/src/DynamicData.Tests/Cache/OnItemFixture.cs +++ b/src/DynamicData.Tests/Cache/OnItemFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class OnItemFixture { @@ -128,7 +119,6 @@ public class Proxy public bool? Active { get; set; } - } public class ProxyEqualityComparer : IEqualityComparer diff --git a/src/DynamicData.Tests/Cache/OrFixture.cs b/src/DynamicData.Tests/Cache/OrFixture.cs index 720d3f0b4..606e10fa8 100644 --- a/src/DynamicData.Tests/Cache/OrFixture.cs +++ b/src/DynamicData.Tests/Cache/OrFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class OrFixture : OrFixtureBase { diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index 8c31979d5..7b9d62a27 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class PageFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs index 67f626b86..27b77d609 100644 --- a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class QueryWhenChangedFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/RefCountFixture.cs b/src/DynamicData.Tests/Cache/RefCountFixture.cs index 14be2f16b..a94a6d7da 100644 --- a/src/DynamicData.Tests/Cache/RefCountFixture.cs +++ b/src/DynamicData.Tests/Cache/RefCountFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class RefCountFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs b/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs index 04d27f619..af9ce551b 100644 --- a/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs +++ b/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs @@ -1,17 +1,4 @@ -#region - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Disposables; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +#region #endregion diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index 62aa30190..61ed56244 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class RightJoinFixture : IDisposable { @@ -135,7 +125,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -144,7 +133,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -153,7 +141,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device3", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain((null, 2)); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -162,7 +149,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain((null, 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -243,7 +229,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); @@ -251,7 +236,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); @@ -259,7 +243,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device3", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain((null, 2)); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); @@ -267,7 +250,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain((null, 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs index 24f013c3a..b1e76980a 100644 --- a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class RightJoinManyFixture : IDisposable { @@ -88,7 +78,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -97,7 +86,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -106,7 +94,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #3", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain((null, "Person #2")); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -115,7 +102,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain((null, "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -197,7 +183,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -205,7 +190,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); @@ -213,7 +197,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #3", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain((null, "Person #2")); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); @@ -221,7 +204,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain((null, "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs index 378b7fa6d..fb66949b7 100644 --- a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SizeLimitFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index f4a68b701..f32c5ae4e 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Disposables; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; // Bind to a list public sealed class SortByAndBindToList : SortAndBindFixture @@ -26,7 +13,6 @@ protected override (ChangeSetAggregator Aggregrator, IList Aggregrator, IList Aggregrator, IList _strings.Dispose(); } - - // Bind to a readonly observable collection - using default comparer public sealed class SortAndBindToReadOnlyObservableCollectionDefaultComparer : SortAndBindFixture { @@ -175,7 +157,6 @@ public void FiresResetWhenThresholdIsMet() _collectionChangedEventArgs.Count.Should().Be(5); _collectionChangedEventArgs.All(a=>a.Action == NotifyCollectionChangedAction.Add).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -194,7 +175,6 @@ public void FiresResetWhenThresholdIsMet() } - [Fact] [Description("Check reset is not fired")] public void NeverFireReset() @@ -209,7 +189,6 @@ public void NeverFireReset() _collectionChangedEventArgs.Count.Should().Be(5); _collectionChangedEventArgs.All(a => a.Action == NotifyCollectionChangedAction.Add).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -235,7 +214,6 @@ public void FireResetOnFirstTimeLoad() _collectionChangedEventArgs.Count.Should().Be(1); _collectionChangedEventArgs.All(a => a.Action == NotifyCollectionChangedAction.Reset).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -254,12 +232,9 @@ public void FireResetOnFirstTimeLoad() } - - public void Dispose() => _source.Dispose(); } - public abstract class SortAndBindFixture : IDisposable { @@ -270,7 +245,6 @@ public abstract class SortAndBindFixture : IDisposable protected readonly IComparer _comparer = Person.DefaultComparer; protected readonly ISourceCache _source = new SourceCache(p => p.Key); - public SortAndBindFixture() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -287,10 +261,8 @@ public SortAndBindFixture() } - protected abstract (ChangeSetAggregator Aggregrator, IList List) SetUpTests(); - [Fact] public void InsertAtBeginning() { @@ -333,7 +305,6 @@ public void InsertAtEnd() _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void InsertInMiddle() { @@ -353,7 +324,6 @@ public void InsertInMiddle() _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void InsertSameLocation() { @@ -377,11 +347,9 @@ void UpdateAndAssetPosition(Person person, int expectedIndex) _boundList.Count.Should().Be(10); - _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void Refresh() { @@ -396,7 +364,6 @@ public void Refresh() RefreshAtAndAssetPosition(toRefresh, p => p.Age = 20, 1); RefreshAtAndAssetPosition(toRefresh, p => p.Age = 25, 1); - // move after RefreshAtAndAssetPosition(toRefresh, p => p.Age = 45, 3); @@ -414,11 +381,9 @@ void RefreshAtAndAssetPosition(Person person, Action action,int expected _boundList.Count.Should().Be(10); - _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void BatchOfVariousChanges() { @@ -452,7 +417,6 @@ public void BatchOfVariousChanges() expectedInOrder.SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void BatchOfVariousEndingInClear() { @@ -470,7 +434,6 @@ public void BatchOfVariousEndingInClear() } - [Fact] public void LargeBatchChange() { @@ -478,12 +441,10 @@ public void LargeBatchChange() _source.AddOrUpdate(Enumerable.Range(0, 100).Select(i => new Person($"P{i}", i))); _source.AddOrUpdate(Enumerable.Range(100, 100).Select(i => new Person($"P{i}", i))); - _boundList.Count.Should().Be(200); _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void BatchUpdateShiftingIndicies() { @@ -519,8 +480,6 @@ public void BatchUpdateShiftingIndicies() _boundList.SequenceEqual(expected).Should().BeTrue(); } - - [Fact] public void RemoveFirst() { @@ -549,7 +508,6 @@ public void RemoveFromEnd() _source.Remove(people[99].Key); _boundList.Count.Should().Be(99); - people.RemoveAt(99); people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -565,15 +523,12 @@ public void RemoveFromMiddle() _source.Remove(people[50].Key); _boundList.Count.Should().Be(99); - people.RemoveAt(IndexFromKey(people[50].Key)); int IndexFromKey(string key) => people.FindIndex(p => p.Key == key); - people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void SortInitialBatch() { @@ -594,14 +549,12 @@ public void UpdateFirst() var update = new Person(toUpdate.Name, toUpdate.Age + 5); - _source.AddOrUpdate(new Person(toUpdate.Name, toUpdate.Age + 5)); people[IndexFromKey(update.Key)] = new Person(toUpdate.Name, toUpdate.Age + 5); int IndexFromKey(string key) => people.FindIndex(p => p.Key == key); - people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -622,7 +575,6 @@ public void UpdateLast() people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void UpdateMiddle() { @@ -649,4 +601,3 @@ public void Dispose() _results.Dispose(); } } - diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index 9698c86e3..78ae06731 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - +namespace DynamicData.Tests.Cache; // Bind to a readonly observable collection public sealed class SortAndBindObservableToReadOnlyObservableCollection : SortAndBindObservableFixture @@ -37,7 +27,6 @@ public abstract class SortAndBindObservableFixture : IDisposable { protected readonly ISourceCache Cache = new SourceCache(p => p.Name); - private readonly RandomPersonGenerator _generator = new(); private readonly ChangeSetAggregator _results; @@ -45,11 +34,9 @@ public abstract class SortAndBindObservableFixture : IDisposable private readonly SortExpressionComparer _oldestComparer = SortExpressionComparer.Descending(p => p.Age).ThenByAscending(p => p.Name); private readonly SortExpressionComparer _defaultComparer = SortExpressionComparer.Ascending(p => p.Name).ThenByAscending(p => p.Age); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] protected readonly BehaviorSubject> ComparerObservable; - protected SortAndBindObservableFixture() { ComparerObservable = new BehaviorSubject>(_defaultComparer); @@ -69,7 +56,6 @@ protected SortAndBindObservableFixture() protected abstract (ChangeSetAggregator Aggregrator, IList List) SetUpTests(); - [Fact] public void SortInitialBatch() { @@ -80,7 +66,6 @@ public void SortInitialBatch() _boundList.SequenceEqual(defaultOrder).Should().BeTrue(); } - [Fact] public void ChangeSort() { @@ -100,7 +85,6 @@ public void ChangeSort() _boundList.SequenceEqual(defaultOrder).Should().BeTrue(); } - public void Dispose() { Cache.Dispose(); diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index 3b3466c85..b85a06138 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -1,15 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - +namespace DynamicData.Tests.Cache; public sealed class SortAndPageAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndPageAndBindFixtureBase { @@ -94,10 +83,8 @@ protected SortAndPageAndBindFixtureBase() List = args.list; } - protected abstract (ChangeSetAggregator aggregator, IList list) SetUpTests(); - [Fact] public void PageGreaterThanNumberOfPagesAvailable() { @@ -112,7 +99,6 @@ public void PageGreaterThanNumberOfPagesAvailable() List.Should().BeEquivalentTo(expectedResult); } - [Fact] public void OverlappingShift() { @@ -156,7 +142,6 @@ public void AddFirstInRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -170,7 +155,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); @@ -191,7 +175,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -235,8 +218,6 @@ public void UpdateStayRange() List.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -255,7 +236,6 @@ public void UpdateOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -305,7 +285,6 @@ public void RemoveOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -374,13 +353,11 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); } - public void Dispose() { Source.Dispose(); diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index 19f177cd4..ef4597c11 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class SortAndPageWithComparerChangesFixture : SortAndPageFixtureBase { @@ -87,7 +76,6 @@ public abstract class SortAndPageFixtureBase : IDisposable protected readonly ChangeSetAggregator> Aggregator; - protected SortAndPageFixtureBase() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -98,10 +86,8 @@ protected SortAndPageFixtureBase() #pragma warning restore CA2214 } - protected abstract ChangeSetAggregator> SetUpTests(); - [Fact] public void InitialBatches() { @@ -113,7 +99,6 @@ public void InitialBatches() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - PageRequests.OnNext(new PageRequest(3, 25)); expectedResult = people.OrderBy(p => p, Comparer).Skip(50).Take(25).ToList(); @@ -127,8 +112,6 @@ public void InitialBatches() [Fact] public void ThrowsForNegativeSizeParameters() => Assert.Throws(() => PageRequests.OnNext(new PageRequest(1, -1))); - - [Fact] public void PageGreaterThanNumberOfPagesAvailable() { @@ -143,7 +126,6 @@ public void PageGreaterThanNumberOfPagesAvailable() actualResult.Should().BeEquivalentTo(expectedResult); } - [Fact] public void OverlappingShift() { @@ -189,7 +171,6 @@ public void AddFirstInRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -203,7 +184,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); @@ -225,7 +205,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -271,8 +250,6 @@ public void UpdateStayRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -291,7 +268,6 @@ public void UpdateOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -341,7 +317,6 @@ public void RemoveOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -410,7 +385,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.SequenceEqual(expectedResult).Should().Be(true); diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index bb8896aac..b6e951ead 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - +namespace DynamicData.Tests.Cache; public sealed class SortAndVirtualizeAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndVirtualizeAndBindFixtureBase { @@ -93,10 +83,8 @@ protected SortAndVirtualizeAndBindFixtureBase() List = args.list; } - protected abstract (ChangeSetAggregator aggregator, IList list) SetUpTests(); - [Fact] public void InitialBatches() { @@ -107,22 +95,15 @@ public void InitialBatches() var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(25, 50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(25).Take(50).ToList(); List.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(40, 50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(40).Take(50).ToList(); List.Should().BeEquivalentTo(expectedResult); } - - - - - [Fact] public void OverlappingShift() { @@ -166,14 +147,12 @@ public void AddFirstInRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { var people = Enumerable.Range(1, 100).Select(i => new Person($"P{i:000}", i)).OrderBy(p => Guid.NewGuid()).ToList(); Source.AddOrUpdate(people); - // insert right at end var person = new Person("X_Last", 100); Source.AddOrUpdate(person); @@ -181,7 +160,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); @@ -202,7 +180,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -246,8 +223,6 @@ public void UpdateStayRange() List.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -265,7 +240,6 @@ public void UpdateOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -313,7 +287,6 @@ public void RemoveOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -381,7 +354,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); } diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index f5d865369..58e5befe4 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -1,18 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - - - - +namespace DynamicData.Tests.Cache; public sealed class SortAndVirtualizeWithComparerChangesFixture : SortAndVirtualizeFixtureBase { @@ -89,7 +75,6 @@ public abstract class SortAndVirtualizeFixtureBase : IDisposable protected readonly ChangeSetAggregator> Aggregator; - protected SortAndVirtualizeFixtureBase() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -100,10 +85,8 @@ protected SortAndVirtualizeFixtureBase() #pragma warning restore CA2214 } - protected abstract ChangeSetAggregator> SetUpTests(); - [Fact] public void InitialBatches() { @@ -115,7 +98,6 @@ public void InitialBatches() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(25,50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(25).Take(50).ToList(); @@ -123,8 +105,6 @@ public void InitialBatches() actualResult.Should().BeEquivalentTo(expectedResult); } - - [Fact] public void OverlappingShift() { @@ -170,7 +150,6 @@ public void AddFirstInRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -184,7 +163,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); @@ -206,7 +184,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -252,8 +229,6 @@ public void UpdateStayRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -272,7 +247,6 @@ public void UpdateOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -322,7 +296,6 @@ public void RemoveOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -391,7 +364,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.SequenceEqual(expectedResult).Should().Be(true); diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 0f228b173..33a473a72 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -1,18 +1,4 @@ -#region - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +#region #endregion diff --git a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs index 6175a0f5c..4098d5f9a 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SortObservableFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs index 99b79fbfd..760d9b7f1 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SourceCacheFixture : IDisposable { @@ -162,8 +149,6 @@ public void EmptyChangesWithFilter() change!.Count.Should().Be(0); } - - [Fact] public void StaticFilterRemove() { @@ -174,7 +159,6 @@ public void StaticFilterRemove() cache.AddOrUpdate(Enumerable.Range(1,10).Select(i=> new SomeObject(i,i))); - above5.Items.Should().BeEquivalentTo(Enumerable.Range(6, 5).Select(i => new SomeObject(i, i))); below5.Items.Should().BeEquivalentTo(Enumerable.Range(1, 5).Select(i => new SomeObject(i, i))); @@ -184,14 +168,12 @@ public void StaticFilterRemove() above5.Count.Should().Be(4); below5.Count.Should().Be(6); - above5.Items.Should().BeEquivalentTo(Enumerable.Range(7, 4).Select(i => new SomeObject(i, i))); below5.Items.Should().BeEquivalentTo(Enumerable.Range(1, 6).Select(i => new SomeObject(i, i == 6 ? -1 : i))); } public record class SomeObject(int Id, int Value); - [Fact] public async Task MultiCacheFanInDoesNotDeadlock() { diff --git a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs index 5d6d26729..0ddc90d6c 100644 --- a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SubscribeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs index 3ba800ee3..4208406ae 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class SuspendNotificationsFixture { @@ -287,4 +277,3 @@ public async Task ConcurrentSuspendDuringResumeDoesNotCorrupt() } } } - diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs index ddc9d6c07..aff4a3270 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Kernel; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class SuspendNotificationsFixture { diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index 5a5b76555..939a24409 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SwitchFixture { @@ -19,7 +9,6 @@ public void ClearsForNewSource() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -45,7 +34,6 @@ public void PoulatesFirstSource() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -59,7 +47,6 @@ public void PropagatesOuterErrors() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -76,7 +63,6 @@ public void PropagatesInnerErrors() using var switchable = new BehaviorSubject>>(source.Connect()); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 8dd0ae91e..40fbe0836 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 892f55535..5c815790f 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { @@ -26,7 +14,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -43,7 +30,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -54,7 +40,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 item was emitted before an error occurred"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted before an error occurred"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -73,7 +58,6 @@ public void KeySelectorThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(static item => (item.Error is not null) @@ -88,7 +72,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -99,7 +82,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 item was emitted before an error occurred"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted before an error occurred"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -109,7 +91,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -124,7 +105,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -143,7 +123,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4 }, "4 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(item5); @@ -153,7 +132,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(item6); @@ -163,7 +141,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, "1 item was emitted, and 1 was evicted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Replacement leaves all other items in-place var item7 = new Item() { Id = 4 }; source.OnNext(item7); @@ -191,7 +168,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -216,7 +192,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("1 item has yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -228,7 +203,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEmpty("all items have expired"); results.HasCompleted.Should().BeTrue("the source, and all outstanding expirations, have completed"); - results.ShouldNotSupportSorting(); } @@ -249,7 +223,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -274,7 +247,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item }, "1 item was emitted"); results.HasCompleted.Should().BeTrue("the source has completed, and no items remain to be expired"); - results.ShouldNotSupportSorting(); } @@ -286,7 +258,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -302,7 +273,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item1); @@ -313,7 +283,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -324,7 +293,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -335,7 +303,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item4); @@ -346,7 +313,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item2, item3 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item5 = new Item() { Id = 2 }; source.OnNext(item5); @@ -357,7 +323,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item3 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item6 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item6); @@ -368,7 +333,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item6 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -377,7 +341,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -386,7 +349,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -395,7 +357,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -404,7 +365,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -416,7 +376,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -432,7 +391,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item1); @@ -443,7 +401,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -454,7 +411,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -465,7 +421,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -474,7 +429,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item expired, and 1 had its lifetime extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -483,7 +437,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -492,7 +445,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -501,7 +453,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -520,7 +471,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet(Item.SelectId) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index f6dece980..9aef8f2a3 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 94213315a..57cd86013 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { @@ -27,7 +14,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -44,7 +30,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -58,7 +43,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Should().BeEmpty("an error occurred during processing of the sequence"); results.RecordedItemsByKey.Values.Should().BeEmpty("an error occurred during processing of the sequence"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -77,7 +61,6 @@ public void KeySelectorThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(static item => (item.Error is not null) @@ -92,7 +75,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -106,7 +88,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Should().BeEmpty("an error occurred during processing of the sequence"); results.RecordedItemsByKey.Values.Should().BeEmpty("an error occurred during processing of the sequence"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -116,7 +97,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -131,7 +111,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -150,7 +129,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4 }, "4 source items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(new[] { item5 }); @@ -160,7 +138,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, "1 source item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(new[] { item6 }); @@ -170,7 +147,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, "1 source item was emitted, and 1 was evicted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Replacement leaves all other items in-place var item7 = new Item() { Id = 4 }; source.OnNext(new[] { item7 }); @@ -203,7 +179,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -228,7 +203,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "3 items were emitted"); results.HasCompleted.Should().BeFalse("2 items have yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(30).Ticks); @@ -240,7 +214,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Where(static item => item.Lifetime is null), "all expirable items have expired"); results.HasCompleted.Should().BeTrue("the source, and all outstanding expirations, have completed"); - results.ShouldNotSupportSorting(); } @@ -266,7 +239,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -291,7 +263,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "3 items were emitted"); results.HasCompleted.Should().BeTrue("the source has completed, and no items remain to be expired"); - results.ShouldNotSupportSorting(); } @@ -303,7 +274,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -319,7 +289,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; var item2 = new Item() { Id = 2 }; @@ -332,7 +301,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; var item5 = new Item() { Id = 2 }; @@ -345,7 +313,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item6 }, "3 items were emitted, and replaced existing items"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -354,7 +321,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "1 source item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -363,7 +329,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -372,7 +337,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "1 source item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -381,7 +345,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -393,7 +356,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -409,7 +371,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; var item2 = new Item() { Id = 2 }; @@ -422,7 +383,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -431,7 +391,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item expired, and 1 had its lifetime extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -440,7 +399,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -449,7 +407,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -458,7 +415,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -477,7 +433,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet(Item.SelectId) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs index c1239a1d8..6de05c9c4 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index d4ea2fd7e..678de9b8c 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; -using DynamicData.Kernel; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ToObservableOptionalFixture : IDisposable { @@ -306,4 +295,3 @@ private class KeyValuePair(string key, string value) public string Value { get; } = value; } } - diff --git a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs index 5c7e84f23..db09b633d 100644 --- a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ToSortedCollectionFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs index b1cedaefe..ccbec0467 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformAsyncFixture { @@ -199,9 +187,6 @@ public void Update() stub.Results.Messages[1].Updates.Should().Be(1, "Should be 1 update"); } - - - [Theory, InlineData(true), InlineData(false)] public void TransformOnRefresh(bool transformOnRefresh) { @@ -218,7 +203,6 @@ public void TransformOnRefresh(bool transformOnRefresh) person.Age = 21; - results.Data.Count.Should().Be(1); results.Data.Lookup("SomeOne").Value.AgeGroup.Should().Be(transformOnRefresh ? "Adult": "Child"); @@ -245,7 +229,6 @@ public void TransformAsyncCancelsTokenOnUnSubscribe() Assert.True(tcs.Task.IsCanceled); } - [Theory, InlineData(10), InlineData(100)] public async Task WithMaxConcurrency(int maxConcurrency) @@ -258,7 +241,6 @@ public async Task WithMaxConcurrency(int maxConcurrency) So it works, but how can it be tested in a scientific way ?? */ - const int transformCount = 100; using var source = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index d149276cd..690f86c66 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformFixture { diff --git a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs index 5ff66a0d0..5be35ff89 100644 --- a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs +++ b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.PLinq; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.PLinq; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs index 4b529b345..a493eee88 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class TransformImmutableFixture { @@ -20,7 +11,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - // Additions var item1 = new Item() { Id = 1, Name = "Item #1" }; var item2 = new Item() { Id = 2, Name = "Item #2" }; @@ -37,7 +27,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(0).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation1.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name, item2.Name }, "2 items were added"); - // Replace items, changing inclusion var item3 = new Item() { Id = item1.Id, Name = "Item #3" }; var item4 = new Item() { Id = item2.Id, Name = "Item #4" }; @@ -54,7 +43,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(1).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation2.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item3.Name, item4.Name }, "2 items were replaced"); - // Refresh items var operation3 = new ChangeSet() { @@ -69,7 +57,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(2).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation3.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item3.Name, item4.Name }, "2 items were refreshed"); - // Move items var operation4 = new ChangeSet() { @@ -84,7 +71,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(3).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation4.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item4.Name, item3.Name }, "2 items were moved"); - // Remove items var operation5 = new ChangeSet() { @@ -99,7 +85,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(4).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation5.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEmpty("2 items were removed"); - results.IsCompleted.Should().BeFalse(); } @@ -112,7 +97,6 @@ public void SourceCompletes_CompletionIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -125,7 +109,6 @@ public void SourceCompletes_CompletionIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, Name = "Item #2" }; source.OnNext(new ChangeSet() @@ -159,7 +142,6 @@ public void SourceCompletesImmediately_CompletionIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - results.Error.Should().BeNull(); results.IsCompleted.Should().BeTrue(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -177,7 +159,6 @@ public void SourceErrors_ErrorIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -190,7 +171,6 @@ public void SourceErrors_ErrorIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, Name = "Item #2" }; source.OnNext(new ChangeSet() @@ -223,7 +203,6 @@ public void SourceErrorsImmediately_ErrorIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - results.Error.Should().Be(error); results.IsCompleted.Should().BeFalse(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -255,7 +234,6 @@ public void TransformFactoryThrows_ExceptionIsCaptured() .TransformImmutable(transformFactory: _ => throw error) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -277,7 +255,6 @@ public void TDestinationIsValueType_DoesNotThrowException() .TransformImmutable(transformFactory: static value => value.Length) .AsAggregator(); - source.OnNext(new ChangeSet() { new(reason: ChangeReason.Add, key: "Item #1", current: "Item #1", index: 0) diff --git a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs index 3781b1a2a..284610236 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class TransformManyAsyncFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformManyFixture.cs b/src/DynamicData.Tests/Cache/TransformManyFixture.cs index fdfe3a1dd..480aae1c6 100644 --- a/src/DynamicData.Tests/Cache/TransformManyFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs index a15d1c051..33d3e7884 100644 --- a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs @@ -1,249 +1,238 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; - -public class TransformManyObservableCollectionFixture -{ - [Fact] - public void FlattenObservableCollection() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.Children, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void FlattenReadOnlyObservableCollection() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.ChildrenReadonly, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void FlattenObservableCache() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.ChildrenCache, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void ObservableCollectionWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.Children, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - [Fact] - public void ReadOnlyObservableCollectionWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.ChildrenReadonly, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - [Fact] - public void ObservableCacheWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.ChildrenCache, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - private class Parent - { - public Parent(int id, IEnumerable children) - { - Id = id; - Children = new ObservableCollection(children); - ChildrenReadonly = new ReadOnlyObservableCollection(Children); - ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); - } - - public Parent(int id) - { - Id = id; - Children = new ObservableCollection(); - ChildrenReadonly = new ReadOnlyObservableCollection(Children); - ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); - } - - public ObservableCollection Children { get; } - +namespace DynamicData.Tests.Cache; + +public class TransformManyObservableCollectionFixture +{ + [Fact] + public void FlattenObservableCollection() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.Children, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void FlattenReadOnlyObservableCollection() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.ChildrenReadonly, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void FlattenObservableCache() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.ChildrenCache, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void ObservableCollectionWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.Children, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + [Fact] + public void ReadOnlyObservableCollectionWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.ChildrenReadonly, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + [Fact] + public void ObservableCacheWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.ChildrenCache, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + private class Parent + { + public Parent(int id, IEnumerable children) + { + Id = id; + Children = new ObservableCollection(children); + ChildrenReadonly = new ReadOnlyObservableCollection(Children); + ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); + } + + public Parent(int id) + { + Id = id; + Children = new ObservableCollection(); + ChildrenReadonly = new ReadOnlyObservableCollection(Children); + ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); + } + + public ObservableCollection Children { get; } + public ReadOnlyObservableCollection ChildrenReadonly { get; } - public IObservableCache ChildrenCache { get; } - - public int Id { get; } - } -} + public IObservableCache ChildrenCache { get; } + + public int Id { get; } + } +} diff --git a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs index 6d14af74c..238d17d53 100644 --- a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformManyRefreshFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs index 409436e1b..465ce180e 100644 --- a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformManySimpleFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index cc37806b7..d43c026ca 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformOnObservableFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index b0b26cfb6..f61f82b73 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; -using DynamicData.Cache; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformSafeAsyncFixture { @@ -201,13 +188,11 @@ public void TransformOnRefresh(bool transformOnRefresh) person.Age = 21; - results.Data.Count.Should().Be(1); results.Data.Lookup("SomeOne").Value.AgeGroup.Should().Be(transformOnRefresh ? "Adult" : "Child"); errorCount.Should().Be(0); } - [Fact] public void TransformSafeAsyncCancelsTokenOnUnSubscribe() { @@ -230,7 +215,6 @@ public void TransformSafeAsyncCancelsTokenOnUnSubscribe() Assert.True(tcs.Task.IsCanceled); } - [Theory, InlineData(10), InlineData(100)] public async Task WithMaxConcurrency(int maxConcurrency) @@ -258,16 +242,13 @@ public async Task WithMaxConcurrency(int maxConcurrency) , TransformAsyncOptions.Default with { MaximumConcurrency = maxConcurrency }) .AsAggregator(); - source.AddOrUpdate(Enumerable.Range(1, transformCount).Select(l => new Person("Person" + l, l))); - await results.Data.CountChanged.Where(c => c == transformCount).Take(1); errorCount.Should().Be(0); } - private class TransformStub : IDisposable { public TransformStub() diff --git a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs index cd9aabc7d..06eabab1a 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformSafeFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs index dace5e75d..a65b2f75a 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformSafeParallelFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs index 33bf44573..78ffdee4d 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformTreeFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs index 68748a69b..5856cce83 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformTreeWithRefreshFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs index 0be034a13..9efe25318 100644 --- a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformWithInlineUpdateFixture { @@ -76,7 +68,6 @@ public void Remove() stub.Results.Data.Count.Should().Be(0, "Should be nothing cached"); } - [Fact] public void TransformOnRefresh() { diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index f9dece32b..235ed9d1b 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TrueForAllFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs index ad5d9086d..227b2be0d 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TrueForAnyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/WatchFixture.cs b/src/DynamicData.Tests/Cache/WatchFixture.cs index 6cc1116b3..093ae47cd 100644 --- a/src/DynamicData.Tests/Cache/WatchFixture.cs +++ b/src/DynamicData.Tests/Cache/WatchFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class WatchFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/WatcherFixture.cs b/src/DynamicData.Tests/Cache/WatcherFixture.cs index 23faff11f..18cefef4d 100644 --- a/src/DynamicData.Tests/Cache/WatcherFixture.cs +++ b/src/DynamicData.Tests/Cache/WatcherFixture.cs @@ -1,19 +1,6 @@ #region -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Experimental; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; #endregion diff --git a/src/DynamicData.Tests/Cache/XorFixture.cs b/src/DynamicData.Tests/Cache/XorFixture.cs index 8a320430a..220d3505a 100644 --- a/src/DynamicData.Tests/Cache/XorFixture.cs +++ b/src/DynamicData.Tests/Cache/XorFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class XOrFixture : XOrFixtureBase { diff --git a/src/DynamicData.Tests/Domain/Animal.cs b/src/DynamicData.Tests/Domain/Animal.cs index 744b058ee..f51606c6b 100644 --- a/src/DynamicData.Tests/Domain/Animal.cs +++ b/src/DynamicData.Tests/Domain/Animal.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading; -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public enum AnimalFamily { diff --git a/src/DynamicData.Tests/Domain/AnimalOwner.cs b/src/DynamicData.Tests/Domain/AnimalOwner.cs index 26049705b..5932a19f1 100644 --- a/src/DynamicData.Tests/Domain/AnimalOwner.cs +++ b/src/DynamicData.Tests/Domain/AnimalOwner.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal sealed class AnimalOwner(string name, Guid? id = null, bool include = true) : AbstractNotifyPropertyChanged, IDisposable { diff --git a/src/DynamicData.Tests/Domain/Fakers.cs b/src/DynamicData.Tests/Domain/Fakers.cs index 720b74565..af32b6fde 100644 --- a/src/DynamicData.Tests/Domain/Fakers.cs +++ b/src/DynamicData.Tests/Domain/Fakers.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; -using Bogus; -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal static class Fakers { diff --git a/src/DynamicData.Tests/Domain/Market.cs b/src/DynamicData.Tests/Domain/Market.cs index a100e6df3..698216d87 100644 --- a/src/DynamicData.Tests/Domain/Market.cs +++ b/src/DynamicData.Tests/Domain/Market.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal interface IMarket { @@ -128,7 +119,6 @@ public int Compare([DisallowNull] IMarket x, [DisallowNull] IMarket y) => } } - internal sealed class FixedMarket : IMarket { public FixedMarket(Func getPrice, int minId, int maxId, bool completable = true) diff --git a/src/DynamicData.Tests/Domain/MarketPrice.cs b/src/DynamicData.Tests/Domain/MarketPrice.cs index f8fb2c6ad..373b47141 100644 --- a/src/DynamicData.Tests/Domain/MarketPrice.cs +++ b/src/DynamicData.Tests/Domain/MarketPrice.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using Bogus; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal sealed class MarketPrice { diff --git a/src/DynamicData.Tests/Domain/ParentAndChildren.cs b/src/DynamicData.Tests/Domain/ParentAndChildren.cs index 746d45fa9..5f12d3cc2 100644 --- a/src/DynamicData.Tests/Domain/ParentAndChildren.cs +++ b/src/DynamicData.Tests/Domain/ParentAndChildren.cs @@ -1,8 +1,4 @@ -using System; - -using DynamicData.Kernel; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class ParentAndChildren : IEquatable { diff --git a/src/DynamicData.Tests/Domain/Person.cs b/src/DynamicData.Tests/Domain/Person.cs index bca018cb6..519d7ecb3 100644 --- a/src/DynamicData.Tests/Domain/Person.cs +++ b/src/DynamicData.Tests/Domain/Person.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public enum Color { diff --git a/src/DynamicData.Tests/Domain/PersonObs.cs b/src/DynamicData.Tests/Domain/PersonObs.cs index 08bd463b7..a729b6b86 100644 --- a/src/DynamicData.Tests/Domain/PersonObs.cs +++ b/src/DynamicData.Tests/Domain/PersonObs.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "Acceptable in test.")] public class PersonObs(string name, int age, string gender = "F", string? parentName = null) : IEquatable diff --git a/src/DynamicData.Tests/Domain/PersonWithChildren.cs b/src/DynamicData.Tests/Domain/PersonWithChildren.cs index 9930cf7cb..475589a92 100644 --- a/src/DynamicData.Tests/Domain/PersonWithChildren.cs +++ b/src/DynamicData.Tests/Domain/PersonWithChildren.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class PersonWithChildren : IKey { diff --git a/src/DynamicData.Tests/Domain/PersonWithEmployment.cs b/src/DynamicData.Tests/Domain/PersonWithEmployment.cs index c95e9ce75..4af98ced4 100644 --- a/src/DynamicData.Tests/Domain/PersonWithEmployment.cs +++ b/src/DynamicData.Tests/Domain/PersonWithEmployment.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class PersonWithEmployment(IGroup source) : IDisposable { diff --git a/src/DynamicData.Tests/Domain/PersonWithFriends.cs b/src/DynamicData.Tests/Domain/PersonWithFriends.cs index 43db20717..70688ff65 100644 --- a/src/DynamicData.Tests/Domain/PersonWithFriends.cs +++ b/src/DynamicData.Tests/Domain/PersonWithFriends.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class PersonWithFriends(string name, int age, IEnumerable friends) : AbstractNotifyPropertyChanged, IKey { diff --git a/src/DynamicData.Tests/Domain/PersonWithGender.cs b/src/DynamicData.Tests/Domain/PersonWithGender.cs index dc4ac6c09..1276dadd2 100644 --- a/src/DynamicData.Tests/Domain/PersonWithGender.cs +++ b/src/DynamicData.Tests/Domain/PersonWithGender.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public record PersonWithAgeGroup(Person Person, string AgeGroup); public class PersonWithGender : IEquatable diff --git a/src/DynamicData.Tests/Domain/PersonWithRelations.cs b/src/DynamicData.Tests/Domain/PersonWithRelations.cs index f488865f5..12b1d39a1 100644 --- a/src/DynamicData.Tests/Domain/PersonWithRelations.cs +++ b/src/DynamicData.Tests/Domain/PersonWithRelations.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class PersonWithRelations : IKey { diff --git a/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs b/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs index 77a799667..9094f2c76 100644 --- a/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs +++ b/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class RandomPersonGenerator { diff --git a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs index 7a11ea949..8ae486de9 100644 --- a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs +++ b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs @@ -1,7 +1,4 @@ -using System; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class SelfObservingPerson : IDisposable { diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 4b9e28c65..be55dbc34 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -1,8 +1,9 @@ - + net9.0 $(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006 2.* + enable @@ -24,4 +25,46 @@ runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData.Tests/EnumerableExFixtures.cs b/src/DynamicData.Tests/EnumerableExFixtures.cs index d25cc8325..9af170dda 100644 --- a/src/DynamicData.Tests/EnumerableExFixtures.cs +++ b/src/DynamicData.Tests/EnumerableExFixtures.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class EnumerableExFixtures { diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 2c18d4302..0d59202a5 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -1,13 +1,4 @@ -using System; -using DynamicData.Cache.Internal; -using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using DynamicData.Kernel; -using Xunit; - -namespace DynamicData.Tests +namespace DynamicData.Tests { public class EnumerableIListFixture { diff --git a/src/DynamicData.Tests/IntegrationTestFixtureBase.cs b/src/DynamicData.Tests/IntegrationTestFixtureBase.cs index d28b8cf87..e7f7c91af 100644 --- a/src/DynamicData.Tests/IntegrationTestFixtureBase.cs +++ b/src/DynamicData.Tests/IntegrationTestFixtureBase.cs @@ -1,6 +1,4 @@ -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; [Collection(CollectionName)] [CollectionDefinition(CollectionName, DisableParallelization = true)] diff --git a/src/DynamicData.Tests/Internal/BitsetFixture.cs b/src/DynamicData.Tests/Internal/BitsetFixture.cs index fd33ce09e..6e21d46e0 100644 --- a/src/DynamicData.Tests/Internal/BitsetFixture.cs +++ b/src/DynamicData.Tests/Internal/BitsetFixture.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class BitsetFixture diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 5f11b9fc5..db82bde0a 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -2,22 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; - -using DynamicData.Internal; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Internal; /// @@ -372,4 +356,4 @@ private sealed class TestObserver : IObserver> public void OnError(Exception error) => Error = error; public void OnCompleted() => IsCompleted = true; } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs index 3062e331f..df812751b 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Internal; +namespace DynamicData.Tests.Internal; public class DeliveryQueueFixture { @@ -557,4 +546,4 @@ public void ErrorTerminatesAndClearsPending() observer.Error.Should().BeSameAs(error); queue.IsTerminated.Should().BeTrue(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs index 2296564ef..ad7897f64 100644 --- a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs +++ b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs @@ -2,13 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class KeyedDisposableFixture @@ -155,4 +148,4 @@ private sealed class TestDisposable(Action onDispose) : IDisposable { public void Dispose() => onDispose(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/NotificationFixture.cs b/src/DynamicData.Tests/Internal/NotificationFixture.cs index d221b0044..0f21f1ed3 100644 --- a/src/DynamicData.Tests/Internal/NotificationFixture.cs +++ b/src/DynamicData.Tests/Internal/NotificationFixture.cs @@ -1,14 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Reactive; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class NotificationFixture diff --git a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs index e67444cb6..5cfd28465 100644 --- a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs @@ -1,18 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class SharedDeliveryQueueFixture @@ -184,4 +173,4 @@ private sealed class TestObserver(Action onNext) : IObserver public void OnError(Exception error) => Error = error; public void OnCompleted() => IsCompleted = true; } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs index 4b3bd980e..e2b87c9f3 100644 --- a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs +++ b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Threading; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public sealed class SwappableLockFixture diff --git a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs index 1044f5cd2..dabc1aa61 100644 --- a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs +++ b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs @@ -1,10 +1,4 @@ -using System.Collections.ObjectModel; -using System.Reactive; -using DynamicData.Binding; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Issues +namespace DynamicData.Tests.Issues { public class EmptyToChangeSetIssue { diff --git a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs index d257b8abb..de6f9a5b2 100644 --- a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs +++ b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using DynamicData.Binding; -using Xunit; - -namespace DynamicData.Tests.Issues +namespace DynamicData.Tests.Issues { public class OnItemRemovedIssue { @@ -53,7 +47,6 @@ public class Proxy public bool? Active { get; set; } - } public class ProxyEqualityComparer : IEqualityComparer diff --git a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs index 438e1bd5f..2683b0d61 100644 --- a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs @@ -1,13 +1,4 @@ -using System.Linq; - -using DynamicData.Cache.Internal; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class CacheUpdaterFixture { diff --git a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs index e7850ce8b..16fe8848c 100644 --- a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class DistinctUpdateFixture { diff --git a/src/DynamicData.Tests/Kernal/EnumerableEx.cs b/src/DynamicData.Tests/Kernal/EnumerableEx.cs index 315c392bb..e4dd573ae 100644 --- a/src/DynamicData.Tests/Kernal/EnumerableEx.cs +++ b/src/DynamicData.Tests/Kernal/EnumerableEx.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static class EnumerableEx { diff --git a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs index ead9fb9da..f5c502d9c 100644 --- a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs +++ b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs @@ -1,12 +1,4 @@ -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class KeyValueFixture { diff --git a/src/DynamicData.Tests/Kernal/OptionFixture.cs b/src/DynamicData.Tests/Kernal/OptionFixture.cs index e93c17e0b..3ac601fd1 100644 --- a/src/DynamicData.Tests/Kernal/OptionFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Globalization; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class OptionFixture { diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 06095bc20..9857bbf29 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class OptionObservableFixture { diff --git a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs index 45c6f965e..63c40e145 100644 --- a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs @@ -1,13 +1,4 @@ -using System.Linq; - -using DynamicData.Cache.Internal; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class SourceUpdaterFixture { diff --git a/src/DynamicData.Tests/Kernal/UpdateFixture.cs b/src/DynamicData.Tests/Kernal/UpdateFixture.cs index 3431a2b9a..1781b0002 100644 --- a/src/DynamicData.Tests/Kernal/UpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/UpdateFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class UpdateFixture { diff --git a/src/DynamicData.Tests/List/AndFixture.cs b/src/DynamicData.Tests/List/AndFixture.cs index 1d18596ad..e18648ea8 100644 --- a/src/DynamicData.Tests/List/AndFixture.cs +++ b/src/DynamicData.Tests/List/AndFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class AndFixture : AndFixtureBase { diff --git a/src/DynamicData.Tests/List/AutoRefreshFixture.cs b/src/DynamicData.Tests/List/AutoRefreshFixture.cs index e6e88aa72..1ad7745be 100644 --- a/src/DynamicData.Tests/List/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/List/AutoRefreshFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class AutoRefreshFixture { diff --git a/src/DynamicData.Tests/List/BatchFixture.cs b/src/DynamicData.Tests/List/BatchFixture.cs index c93fe2d08..6a48657b5 100644 --- a/src/DynamicData.Tests/List/BatchFixture.cs +++ b/src/DynamicData.Tests/List/BatchFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class BatchFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/BatchIfFixture.cs b/src/DynamicData.Tests/List/BatchIfFixture.cs index ebbb28484..ab0b75f96 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class BatchIfFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index f192a17ca..5468f5eaa 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class BatchIfWithTimeOutFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/BufferFixture.cs b/src/DynamicData.Tests/List/BufferFixture.cs index e02330f98..abd2ae4e8 100644 --- a/src/DynamicData.Tests/List/BufferFixture.cs +++ b/src/DynamicData.Tests/List/BufferFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class BufferFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/BufferInitialFixture.cs b/src/DynamicData.Tests/List/BufferInitialFixture.cs index cd32c1b23..7439a7784 100644 --- a/src/DynamicData.Tests/List/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/List/BufferInitialFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class BufferInitialFixture { diff --git a/src/DynamicData.Tests/List/CastFixture.cs b/src/DynamicData.Tests/List/CastFixture.cs index f6a5ac9f9..38b5d57e0 100644 --- a/src/DynamicData.Tests/List/CastFixture.cs +++ b/src/DynamicData.Tests/List/CastFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class CastFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs index c8b65086c..1dc713df6 100644 --- a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs +++ b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ChangeAwareListFixture { diff --git a/src/DynamicData.Tests/List/ChangeSetFixture.cs b/src/DynamicData.Tests/List/ChangeSetFixture.cs index 28027926d..25aa530ee 100644 --- a/src/DynamicData.Tests/List/ChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ChangeSetFixture.cs @@ -1,21 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Management; -using System.Reflection; -using System.Threading.Channels; - -using Argon; - -using Bogus; - -using FluentAssertions; - -using Xunit; -using Xunit.Abstractions; -using Xunit.Sdk; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ChangeSetFixture { diff --git a/src/DynamicData.Tests/List/CloneChangesFixture.cs b/src/DynamicData.Tests/List/CloneChangesFixture.cs index b043cf78f..6e7a623bd 100644 --- a/src/DynamicData.Tests/List/CloneChangesFixture.cs +++ b/src/DynamicData.Tests/List/CloneChangesFixture.cs @@ -1,14 +1,4 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class CloneChangesFixture { diff --git a/src/DynamicData.Tests/List/CloneFixture.cs b/src/DynamicData.Tests/List/CloneFixture.cs index 4e050e305..0ce2c6782 100644 --- a/src/DynamicData.Tests/List/CloneFixture.cs +++ b/src/DynamicData.Tests/List/CloneFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class CloneFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/CreationFixtures.cs b/src/DynamicData.Tests/List/CreationFixtures.cs index ae7ca0d0b..5786ad3c5 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ListCreationFixtures { diff --git a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs index 1f8f725b3..12e3c51ab 100644 --- a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DeferAnsdSkipFixture { diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index 2d06a1122..1388c61d5 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class DisposeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/DistinctValuesFixture.cs b/src/DynamicData.Tests/List/DistinctValuesFixture.cs index 1a7bcf214..4bff7b731 100644 --- a/src/DynamicData.Tests/List/DistinctValuesFixture.cs +++ b/src/DynamicData.Tests/List/DistinctValuesFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DistinctValuesFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/DynamicAndFixture.cs b/src/DynamicData.Tests/List/DynamicAndFixture.cs index 7ae39e813..90d16ff0e 100644 --- a/src/DynamicData.Tests/List/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/List/DynamicAndFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DynamicAndFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/DynamicExceptFixture.cs b/src/DynamicData.Tests/List/DynamicExceptFixture.cs index 3fbf868ef..a8b5bd16d 100644 --- a/src/DynamicData.Tests/List/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/List/DynamicExceptFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DynamicExceptFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/DynamicOrFixture.cs b/src/DynamicData.Tests/List/DynamicOrFixture.cs index 415c37330..3ec3667d1 100644 --- a/src/DynamicData.Tests/List/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicOrFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DynamicOrRefreshFixture { diff --git a/src/DynamicData.Tests/List/DynamicXOrFixture.cs b/src/DynamicData.Tests/List/DynamicXOrFixture.cs index ef6326976..b395fc59e 100644 --- a/src/DynamicData.Tests/List/DynamicXOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicXOrFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class DynamicXOrFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/EditDiffFixture.cs b/src/DynamicData.Tests/List/EditDiffFixture.cs index 3a96e6195..f74bb361a 100644 --- a/src/DynamicData.Tests/List/EditDiffFixture.cs +++ b/src/DynamicData.Tests/List/EditDiffFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class EditDiffFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/ExceptFixture.cs b/src/DynamicData.Tests/List/ExceptFixture.cs index d74eff07b..9f1293a84 100644 --- a/src/DynamicData.Tests/List/ExceptFixture.cs +++ b/src/DynamicData.Tests/List/ExceptFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ExceptFixture : ExceptFixtureBase { diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index 9ad68eb16..d878c6fca 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -1,21 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using Microsoft.Reactive.Testing; - -using Bogus; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class ExpireAfterFixture { @@ -195,7 +178,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() // Not testing Refresh changes, since ISourceList doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -331,7 +313,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() source.Move(2, 3); scheduler.AdvanceBy(1); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -415,7 +396,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() var item1 = new TestItem() { Id = 1, Expiration = DateTimeOffset.FromUnixTimeMilliseconds(10) }; source.Add(item1); - results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); source.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs index 781165835..ff0ab2628 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class FilterControllerFixtureWithClearAndReplace : IDisposable { diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs index fb3b6e855..29b141636 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class FilterControllerFixtureWithDiffSet : IDisposable { diff --git a/src/DynamicData.Tests/List/FilterFixture.Base.cs b/src/DynamicData.Tests/List/FilterFixture.Base.cs index 3282e1fe8..30f8d498f 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class FilterFixture { @@ -30,7 +22,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -47,7 +38,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -74,7 +64,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang // Setup using var source = new TestSourceList(); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -89,7 +78,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddRange(new[] { @@ -127,7 +115,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -144,7 +131,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, source.Edit(items => { @@ -159,7 +145,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for excluded items source.Edit(items => { @@ -200,7 +185,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -215,7 +199,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -228,7 +211,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -260,7 +242,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange new Item() { Id = 6, IsIncluded = false } }); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -277,7 +258,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and replace items) source.Edit(items => { @@ -296,7 +276,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and replace items) source.Edit(items => { @@ -334,7 +313,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -351,7 +329,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(Item.FilterByIsIncluded).ToArray()); diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index 927deae5d..7b4ca83b2 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class FilterFixture { @@ -30,7 +20,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() 2 }); - // UUT Initialization using var subscription = source.Connect() .Filter(static item => (item % 2) is 0) @@ -45,7 +34,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(2); @@ -56,7 +44,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(3); @@ -64,7 +51,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() results.RecordedChangeSets.Skip(2).Should().BeEmpty("an operation was performed upon an excluded item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(2); @@ -82,7 +68,6 @@ public void ExcludedItemIsAdded_NoChangesAreMade() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -95,7 +80,6 @@ public void ExcludedItemIsAdded_NoChangesAreMade() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Add(new Item() { Id = 1, IsIncluded = false }); @@ -120,7 +104,6 @@ public void ExcludedItemIsRemoved_NoChangesAreMade() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -135,7 +118,6 @@ public void ExcludedItemIsRemoved_NoChangesAreMade() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveAt(5); @@ -160,7 +142,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -175,7 +156,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -190,7 +170,6 @@ public void ItemsAreAdded_MatchingItemsPropagate() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -203,7 +182,6 @@ public void ItemsAreAdded_MatchingItemsPropagate() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddRange(new[] { @@ -239,7 +217,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -254,7 +231,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, source.Edit(items => { @@ -269,7 +245,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for excluded items source.Edit(items => { @@ -298,7 +273,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -311,7 +285,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -324,7 +297,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -354,7 +326,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -369,7 +340,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and replace items) source.Edit(items => { @@ -388,7 +358,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and replace items) source.Edit(items => { @@ -414,7 +383,6 @@ public void MatchingItemIsAdded_ItemPropagates() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -427,7 +395,6 @@ public void MatchingItemIsAdded_ItemPropagates() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Add(new Item() { Id = 1, IsIncluded = true }); @@ -453,7 +420,6 @@ public void MatchingItemIsRemoved_RemovalPropagates() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -468,7 +434,6 @@ public void MatchingItemIsRemoved_RemovalPropagates() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var removedItem = source.Items[2]; source.RemoveAt(2); @@ -497,7 +462,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -512,7 +476,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(Item.FilterByIsIncluded).ToArray()); @@ -546,7 +509,6 @@ public void SourceCompletes_CompletionPropagates(SourceType sourceType) if (sourceType is SourceType.Immediate) source.Complete(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -615,7 +577,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .Filter(Item.FilterByIsIncluded) @@ -628,7 +589,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItems.Should().BeEmpty("the source has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index d3f28efd3..e3124caff 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; -using Xunit.Abstractions; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public partial class FilterFixture { @@ -42,13 +27,11 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter .ValidateChangeSets() .RecordListItems(out var results); - // Set initial state predicateState.OnNext(new()); results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test Add, with an included item var item1 = new Item() { Id = 1, IsIncluded = true }; source.Add(item1); @@ -56,14 +39,12 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Count.Should().Be(1, "one source operation was performed, with one included item added"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Add, with an excluded item var item2 = new Item() { Id = 2, IsIncluded = false }; source.Add(item2); results.RecordedChangeSets.Skip(1).Should().BeEmpty("one source operation was performed, but no included items were affected"); - // Test AddRange, with both included and excluded items var item3 = new Item() { Id = 3, IsIncluded = false }; var item4 = new Item() { Id = 4, IsIncluded = true }; @@ -76,7 +57,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed, with 3 included items added"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Refresh, with no item mutations. source.Refresh(Enumerable.Range(0, source.Count)); @@ -85,7 +65,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(2).First().Select(static change => change.Item.Current).Should().BeEquivalentTo(EnumerateFilteredItems(), "all included items should have been refreshed"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Refresh, with item mutations affecting filtering. item1.IsIncluded = !item1.IsIncluded; item3.IsIncluded = !item3.IsIncluded; @@ -96,27 +75,23 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed, with items being included and excluded"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Remove, with an included item source.RemoveAt(3); results.RecordedChangeSets.Skip(4).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Remove, with an excluded item source.RemoveAt(3); results.RecordedChangeSets.Skip(5).Should().BeEmpty("one source operation was performed, but no included items were affected"); - // Test Remove, with both included and excluded items source.RemoveRange(index: 2, count: 2); results.RecordedChangeSets.Skip(5).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Replace, not affecting filtering var item9 = new Item() { Id = 9, IsIncluded = false }; var item10 = new Item() { Id = 10, IsIncluded = true }; @@ -129,7 +104,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(6).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Replace, affecting filtering var item11 = new Item() { Id = 11, IsIncluded = true }; var item12 = new Item() { Id = 12, IsIncluded = false }; @@ -142,7 +116,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(7).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Move of an included item, relative to another included item var item13 = new Item() { Id = 13, IsIncluded = true }; source.Add(item13); @@ -160,7 +133,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - // Test Move of an excluded item source.Move(4, 2); @@ -175,7 +147,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter break; } - // Test Clear, with included items source.Clear(); @@ -191,7 +162,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - // Test Clear, with only excluded items source.Add(new Item() { Id = 14, IsIncluded = false }); source.Clear(); @@ -208,7 +178,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - IEnumerable EnumerateFilteredItems() => source.Items.Where(static item => item.IsIncluded); } @@ -231,14 +200,12 @@ public void ChangesAreMadeAfterMultiplePredicateStateChanges_ItemsAreFilteredWit .ValidateChangeSets() .RecordListItems(out var results); - // Publish multiple state changes predicateState.OnNext(2); predicateState.OnNext(3); results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test filtering of items, by state source.AddRange(new[] { @@ -270,10 +237,8 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat .ValidateChangeSets() .RecordListItems(out var results); - results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test Add, with an included item var item1 = new Item() { Id = 1, IsIncluded = true }; source.Add(item1); @@ -338,7 +303,6 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat results.RecordedChangeSets.Should().BeEmpty("the predicate state has not initialized"); - // Set initial state predicateState.OnNext(new()); @@ -362,7 +326,6 @@ public void FilterPolicyIsClearAndReplace_ReFilteringPreservesOrder() .ValidateChangeSets() .RecordListItems(out var results); - // Test filtering of items, by state source.AddRange(new[] { @@ -416,7 +379,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(ListFilterPolicy filterPoli .ValidateChangeSets() .RecordListItems(out var results); - // Test filtering of items, by state source.AddRange(new[] { @@ -429,14 +391,12 @@ public void PredicateStateChanges_ItemsAreReFiltered(ListFilterPolicy filterPoli results.RecordedChangeSets.Count.Should().Be(1, "one source operation was performed"); ShouldBeValid(results, EnumerateFilteredItems()); - // Publish a state change, to change the filtering predicateState.OnNext(2); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); ShouldBeValid(results, EnumerateFilteredItems()); - IEnumerable EnumerateFilteredItems() => source.Items.Where(item => item.Id == predicateState.Value); } @@ -505,7 +465,6 @@ public void PredicateStateErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy .ValidateChangeSets() .RecordListItems(out var results); - var error = new Exception("This is a test."); predicateState.OnError(error); @@ -566,7 +525,6 @@ public async Task SourceAndPredicateStateNotifyFromDifferentThreads_FilteringIsT valueCount: 5_000, randomizer: randomizer); - using var source = new Subject>(); using var predicateState = new Subject(); @@ -711,7 +669,6 @@ public void SourceErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy) .ValidateChangeSets() .RecordListItems(out var results); - var error = new Exception("This is a test."); source.OnError(error); @@ -773,7 +730,6 @@ public void SubscriptionIsDisposed_UnsubscriptionIsPropagated(ListFilterPolicy f .ValidateChangeSets() .RecordListItems(out var results); - subscription.Dispose(); source.HasObservers.Should().BeFalse("subscription disposal should be propagated to all input streams"); @@ -800,7 +756,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi .ValidateChangeSets() .RecordListItems(out var results); - // Initialize the predicate predicateState.OnNext(new object()); @@ -808,7 +763,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi results.RecordedChangeSets[0].Should().BeEmpty("there are no items in the collection"); ShouldBeValid(results, Enumerable.Empty()); - // Publish an empty changeset source.OnNext(ChangeSet.Empty); @@ -816,7 +770,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi results.RecordedChangeSets.Skip(1).First().Should().BeEmpty("the source changeset was empty"); ShouldBeValid(results, Enumerable.Empty()); - // Publish a changeset with only excluded items source.OnNext(new ChangeSet() { diff --git a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs index 8cb3e152b..30980bf68 100644 --- a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; //TODO: To optimise this, we need to introduce replace range, or specify a buffer public class FilterOnObservableFixture diff --git a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs index 9d9dbfe03..61077ba62 100644 --- a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class FilterOnPropertyFixture { diff --git a/src/DynamicData.Tests/List/FilterWithObservable.cs b/src/DynamicData.Tests/List/FilterWithObservable.cs index 9a71359c5..bbf8e8198 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Aggregation; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ForEachChangeFixture.cs b/src/DynamicData.Tests/List/ForEachChangeFixture.cs index 589397d31..a3a842c83 100644 --- a/src/DynamicData.Tests/List/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/List/ForEachChangeFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ForEachChangeFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index 2f1913c48..cd388449b 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class FromAsyncFixture { diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index cbf674654..4416994c4 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class GroupImmutableFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/GroupOnFixture.cs b/src/DynamicData.Tests/List/GroupOnFixture.cs index 61164d3c3..360d1eeb5 100644 --- a/src/DynamicData.Tests/List/GroupOnFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class GroupOnFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs index aa9442888..985067599 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class GroupOnPropertyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs index 0f55473d4..09539a0b2 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class GroupOnPropertyWithImmutableStateFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs index 253a70070..2cbb53abe 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Microsoft.Reactive.Testing; -using Xunit; -using System.Collections.Concurrent; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class MergeChangeSetsFixture : IDisposable { @@ -273,7 +257,6 @@ public async Task ResultContainsChildrenAddedWithInsertEnum() CheckResultContents(_animalOwners, results); } - [Fact] public async Task ResultContainsCorrectItemsAfterChildReplacementObs() { diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index bdac643d9..508c6512a 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive; -using System.Reactive.Linq; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class MergeManyChangeSetsCacheFixture : IDisposable { @@ -48,7 +32,6 @@ public MergeManyChangeSetsCacheFixture() _marketListResults = _marketList.Connect().AsAggregator(); } - [Theory] [InlineData(5, 7)] [InlineData(10, 50)] diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs index ea8019ea4..fef9be2ae 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs @@ -1,9 +1,4 @@ -using System.Linq; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class MergeManyChangeSetsFixture { @@ -44,12 +39,10 @@ public void MergeManyShouldWork() a.ReplaceAt(0,100); new[] { 2, 100 }.Should().BeEquivalentTo(d.Items); - var f = new SourceList(); f.AddRange(Enumerable.Range(10,5)); parent.ReplaceAt(2,f); - new[] { 2, 100, 10,11,12,13,14 }.Should().BeEquivalentTo(d.Items); } } diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index 41cec34e1..8521d48ee 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class MergeManyChangeSetsListFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 997e91f9f..8fcfd6b9e 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class MergeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/OnItemAddedFixture.cs b/src/DynamicData.Tests/List/OnItemAddedFixture.cs index 3585426cb..ad057b97f 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OnItemAddedFixture { @@ -56,7 +47,6 @@ public void ItemIsAdded_AddActionIsInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Insert( index: insertionIndex, @@ -112,7 +102,6 @@ public void ItemIsMoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Move( original: originalIndex, @@ -165,7 +154,6 @@ public void ItemIsRefreshed_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Refresh(refreshIndex); @@ -217,7 +205,6 @@ public void ItemIsRemoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.RemoveAt(removalIndex); @@ -268,7 +255,6 @@ public void ItemIsReplaced_AddActionIsInvokedForNewItem( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.ReplaceAt( index: replacementIndex, @@ -323,7 +309,6 @@ public void ItemRangeIsRemoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.RemoveRange( index: removalIndex, @@ -372,7 +357,6 @@ public void ItemsAreCleared_AddActionIsNotInvoked(int initialItemCount) because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Clear(); @@ -422,7 +406,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates() because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Complete(); @@ -504,7 +487,6 @@ public void SourceFailsAsynchronously_CompletionPropagates() because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index c044d8e89..4f919d248 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OnItemRefreshedFixture { @@ -49,7 +40,6 @@ public void ItemIsAdded_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Insert( index: insertionIndex, @@ -101,7 +91,6 @@ public void ItemIsMoved_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Move( original: originalIndex, @@ -150,7 +139,6 @@ public void ItemIsRefreshed_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action var refreshedItem = source.Items[refreshIndex]; source.Refresh(refreshIndex); @@ -199,7 +187,6 @@ public void ItemIsRemoved_RefreshActionIsInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); @@ -247,7 +234,6 @@ public void ItemIsReplaced_RefreshActionIsInvokedForOldItem( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.ReplaceAt( index: replacementIndex, @@ -298,7 +284,6 @@ public void ItemRangeIsRemoved_RefreshActionIsInvokedForEachItem( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.RemoveRange( index: removalIndex, @@ -343,7 +328,6 @@ public void ItemsAreCleared_RefreshActionIsInvokedForEachItem(int initialItemCou refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Clear(); @@ -389,7 +373,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates() refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Complete(); @@ -463,7 +446,6 @@ public void SourceFailsAsynchronously_CompletionPropagates() refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index 6b91fc11d..1f777c389 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OnItemRemovedFixture { @@ -74,7 +64,6 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -142,7 +131,6 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -206,7 +194,6 @@ public void ItemIsAdded_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Insert( index: insertionIndex, @@ -252,7 +239,6 @@ public void ItemIsMoved_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Move( original: originalIndex, @@ -296,7 +282,6 @@ public void ItemIsRemoved_RemoveActionIsInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); @@ -339,7 +324,6 @@ public void ItemIsRefreshed_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Refresh(refreshIndex); @@ -380,7 +364,6 @@ public void ItemIsReplaced_RemoveActionIsInvokedForOldItem( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var replacedItem = source.Items[replacementIndex]; source.ReplaceAt( @@ -429,7 +412,6 @@ public void ItemRangeIsRemoved_RemoveActionIsInvokedForEachItem( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var removedItems = source.Items .Skip(removalIndex) @@ -473,7 +455,6 @@ public void ItemsAreCleared_RemoveActionIsInvokedForEachItem(int initialItemCoun removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var clearedItems = source.Items .ToArray(); @@ -520,7 +501,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates(bool invokeOnUnsu removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Complete(); @@ -602,7 +582,6 @@ public void SourceFailsAsynchronously_CompletionPropagates(bool invokeOnUnsubscr removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/OrFixture.cs b/src/DynamicData.Tests/List/OrFixture.cs index c4c973aa2..86c989da2 100644 --- a/src/DynamicData.Tests/List/OrFixture.cs +++ b/src/DynamicData.Tests/List/OrFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OrFixture : OrFixtureBase { diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index 5091b06b7..beec3b45f 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class PageFixture : IDisposable { @@ -168,7 +155,6 @@ public void SimplePaging() sut.Paged.Count.Should().Be(3); } - [Fact] public void DoesNotThrowWithDuplicates() { diff --git a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs index 49c5cd27e..54bc070fa 100644 --- a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class QueryWhenChangedFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs index 1d79be23e..0ffcb2c91 100644 --- a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs +++ b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class RecursiveTransformManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/RefCountFixture.cs b/src/DynamicData.Tests/List/RefCountFixture.cs index c0d86e06d..53b99fa03 100644 --- a/src/DynamicData.Tests/List/RefCountFixture.cs +++ b/src/DynamicData.Tests/List/RefCountFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class RefCountFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/RemoveManyFixture.cs b/src/DynamicData.Tests/List/RemoveManyFixture.cs index b0809011e..4883c5b81 100644 --- a/src/DynamicData.Tests/List/RemoveManyFixture.cs +++ b/src/DynamicData.Tests/List/RemoveManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class RemoveManyFixture { diff --git a/src/DynamicData.Tests/List/ReverseFixture.cs b/src/DynamicData.Tests/List/ReverseFixture.cs index 68cb3685d..dd3e87329 100644 --- a/src/DynamicData.Tests/List/ReverseFixture.cs +++ b/src/DynamicData.Tests/List/ReverseFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ReverseFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SelectFixture.cs b/src/DynamicData.Tests/List/SelectFixture.cs index 6fd4fe0f7..687b732a0 100644 --- a/src/DynamicData.Tests/List/SelectFixture.cs +++ b/src/DynamicData.Tests/List/SelectFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Alias; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Alias; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/SizeLimitFixture.cs b/src/DynamicData.Tests/List/SizeLimitFixture.cs index f07825d14..8fddb778e 100644 --- a/src/DynamicData.Tests/List/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/List/SizeLimitFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SizeLimitFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index 7f2a7dea3..09b62d074 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -1,21 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SortChangedFixture { private static readonly IComparer DefaultComparer = SortExpressionComparer.Ascending(x => x.Number); - /// /// See https://github.com/reactivemarbles/DynamicData/issues/473 /// @@ -36,11 +24,9 @@ public void SortsWithoutError() sorter.OnNext(SortExpressionComparer.Descending(x => x.Number)); - bound.Select(x => x.Number).Should().BeInDescendingOrder(); } - private class ListItem(int number) : IComparable { public int Number { get; } = number; diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index 63eab9e03..e05c33e6e 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SortMutableFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs index d5e03c2a5..4d37c5f10 100644 --- a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs +++ b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SortPrimitiveFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SourceListFixture.cs b/src/DynamicData.Tests/List/SourceListFixture.cs index dc37bdaed..a9cde688c 100644 --- a/src/DynamicData.Tests/List/SourceListFixture.cs +++ b/src/DynamicData.Tests/List/SourceListFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SourceListFixture { @@ -17,7 +11,6 @@ public void InitialChangeIsRange() source.Connect().Subscribe(changeSets.Add).Dispose(); - changeSets[0].First().Type.Should().Be(ChangeType.Range); changeSets[0].First().Range.Index.Should().Be(0); } diff --git a/src/DynamicData.Tests/List/SourceListPreviewFixture.cs b/src/DynamicData.Tests/List/SourceListPreviewFixture.cs index cb61bbfb5..075711eae 100644 --- a/src/DynamicData.Tests/List/SourceListPreviewFixture.cs +++ b/src/DynamicData.Tests/List/SourceListPreviewFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SourceListPreviewFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SubscribeManyFixture.cs b/src/DynamicData.Tests/List/SubscribeManyFixture.cs index 8f8995a2e..75281e2ff 100644 --- a/src/DynamicData.Tests/List/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/List/SubscribeManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SubscribeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SwitchFixture.cs b/src/DynamicData.Tests/List/SwitchFixture.cs index abcdaa8d3..1150f5f7b 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SwitchFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/ToCollectionFixture.cs b/src/DynamicData.Tests/List/ToCollectionFixture.cs index a46aa790f..a6e2c2edd 100644 --- a/src/DynamicData.Tests/List/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/List/ToCollectionFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Linq; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ToCollectionFixture { diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 0a60bc356..86b3ca340 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index 887a230d4..41eb3d37d 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { @@ -26,7 +14,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(expireAfter: static item => (item.Error is not null) @@ -41,7 +28,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItems.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -59,7 +45,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject(); - // UUT Initialization using var subscription = source .ToObservableChangeSet(limitSizeTo: 5) @@ -72,7 +57,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItems.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -93,7 +77,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(item5); @@ -105,7 +88,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(item6); @@ -135,7 +117,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -161,7 +142,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("1 item has yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -191,7 +171,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -226,7 +205,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -241,7 +219,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItems.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item1); @@ -254,7 +231,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -267,7 +243,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -280,7 +255,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -291,7 +265,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -302,7 +275,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -313,7 +285,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -340,7 +311,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet() diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 505404290..9b6ca5766 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 55b1fdaae..b7fec6533 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { @@ -27,7 +14,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(expireAfter: static item => (item.Error is not null) @@ -42,7 +28,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItems.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -63,7 +48,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .ToObservableChangeSet(limitSizeTo: 5) @@ -76,7 +60,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItems.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -97,7 +80,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(new[] { item5 }); @@ -109,7 +91,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(new[] { item6 }); @@ -144,7 +125,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -170,7 +150,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("2 items have yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(30).Ticks); @@ -207,7 +186,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -242,7 +220,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -257,7 +234,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItems.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; var item2 = new Item() { Id = 2 }; @@ -272,7 +248,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -283,7 +258,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -294,7 +268,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -305,7 +278,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -332,7 +304,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet() diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs index e42998264..351fb6450 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/List/TransformAsyncFixture.cs b/src/DynamicData.Tests/List/TransformAsyncFixture.cs index be4b8f623..6a71a9e87 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; [Obsolete("Not obsolete - test commented out due to test run freezing on Appveyor")] public class TransformAsyncFixture : IDisposable diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index 0841ae4f4..0d54f5f32 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class TransformFixture : IDisposable { @@ -131,7 +123,6 @@ public void Update() _results.Messages[0].Replaced.Should().Be(0, "Should be 1 update"); } - [Fact] public void MultipleSubscribersShouldNotShareState() { diff --git a/src/DynamicData.Tests/List/TransformManyFixture.cs b/src/DynamicData.Tests/List/TransformManyFixture.cs index caf8bc6c7..eda7cff58 100644 --- a/src/DynamicData.Tests/List/TransformManyFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class TransformManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs index f713c1ee9..652f2a6cf 100644 --- a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs @@ -1,14 +1,4 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class TransformManyObservableCollectionFixture { diff --git a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs index 49c34de51..92e66c26e 100644 --- a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class TransformManyProjectionFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs index f77aa95eb..dfb7d5617 100644 --- a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class TransformManyRefreshFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/VirtualisationFixture.cs b/src/DynamicData.Tests/List/VirtualisationFixture.cs index 66f681bff..644cae0f1 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class VirtualisationFixture : IDisposable { @@ -130,7 +119,6 @@ public void VirtualiseInitial() _results.Data.Items.Should().BeEquivalentTo(expected); } - [Fact] public void DoesNotThrowWithDuplicates() { diff --git a/src/DynamicData.Tests/List/XOrFixture.cs b/src/DynamicData.Tests/List/XOrFixture.cs index 8f66b0d20..9300ea90f 100644 --- a/src/DynamicData.Tests/List/XOrFixture.cs +++ b/src/DynamicData.Tests/List/XOrFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class XOrFixture : XOrFixtureBase { diff --git a/src/DynamicData.Tests/ObservableCollectionExFixture.cs b/src/DynamicData.Tests/ObservableCollectionExFixture.cs index 0d93711a9..3c0779d1f 100644 --- a/src/DynamicData.Tests/ObservableCollectionExFixture.cs +++ b/src/DynamicData.Tests/ObservableCollectionExFixture.cs @@ -1,13 +1,4 @@ - -using System.Collections.ObjectModel; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class ObservableCollectionExFixture { @@ -35,7 +26,6 @@ public void CanConvertToObservableChangeSetCache() one.Should().BeEquivalentTo(_person1); } - [Fact] public void ReplacingAnItemWithSameProducesUpdate() { diff --git a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs index bb4e7cb3f..a9148584b 100644 --- a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class CacheChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs index 7f0eba1b9..96870d64c 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class CacheItemRecordingObserver : RecordingObserverBase> diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs index 6dfbfa047..caf8e91f8 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class CacheItemRecordingObserverAssertions { diff --git a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs index 76433346f..379b7ceef 100644 --- a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal sealed class NoOpComparer : IComparer { @@ -17,7 +13,6 @@ internal sealed class NoOpEqualityComparer : IEqualityComparer public int GetHashCode([DisallowNull] T obj) => throw new NotImplementedException(); } - internal sealed class InvertedComparer(IComparer original) : IComparer { private readonly IComparer _original = original; @@ -25,7 +20,6 @@ internal sealed class InvertedComparer(IComparer original) : IComparer public int Compare(T x, T y) => _original.Compare(x, y) * -1; } - internal static class ComparerExtensions { public static IComparer Invert(this IComparer comparer) => new InvertedComparer(comparer); diff --git a/src/DynamicData.Tests/Utilities/FakeScheduler.cs b/src/DynamicData.Tests/Utilities/FakeScheduler.cs index fc2b19bbf..2ffd3cd62 100644 --- a/src/DynamicData.Tests/Utilities/FakeScheduler.cs +++ b/src/DynamicData.Tests/Utilities/FakeScheduler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal sealed class FakeScheduler : IScheduler diff --git a/src/DynamicData.Tests/Utilities/FakerExtensions.cs b/src/DynamicData.Tests/Utilities/FakerExtensions.cs index 1388d3b80..50d225a04 100644 --- a/src/DynamicData.Tests/Utilities/FakerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FakerExtensions.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Concurrency; -using Bogus; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class FakerExtensions { diff --git a/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs b/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs index cb3c819cf..bce089232 100644 --- a/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class FunctionalExtensions { diff --git a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs index d0b336e16..22f14d758 100644 --- a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class ListChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs index 09eaa8819..c9ad14179 100644 --- a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class ListItemRecordingObserver : RecordingObserverBase> diff --git a/src/DynamicData.Tests/Utilities/ObservableEx.cs b/src/DynamicData.Tests/Utilities/ObservableEx.cs index df45f9f75..715c880b5 100644 --- a/src/DynamicData.Tests/Utilities/ObservableEx.cs +++ b/src/DynamicData.Tests/Utilities/ObservableEx.cs @@ -1,8 +1,4 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; /// /// Extra Observable Tools for Testing diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index acd336d0e..ffe4958a7 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using System.Threading; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class ObservableExtensions { @@ -402,16 +391,16 @@ public static IObservable ValidateSynchronization(this IObservable sour // This allows the operator to be combined with other operators that might be testing for things that the safeguards normally prevent. => RawAnonymousObservable.Create(observer => { - var inFlightNotification = null as Notification; + var inFlightNotification = null as System.Reactive.Notification; var synchronizationGate = new object(); // Not using .Do() so we can track the *entire* in-flight period of a notification, including all synchronous downstream processing. return source.SubscribeSafe(RawAnonymousObserver.Create( - onNext: value => ProcessIncomingNotification(Notification.CreateOnNext(value)), - onError: error => ProcessIncomingNotification(Notification.CreateOnError(error)), - onCompleted: () => ProcessIncomingNotification(Notification.CreateOnCompleted()))); + onNext: value => ProcessIncomingNotification(System.Reactive.Notification.CreateOnNext(value)), + onError: error => ProcessIncomingNotification(System.Reactive.Notification.CreateOnError(error)), + onCompleted: () => ProcessIncomingNotification(System.Reactive.Notification.CreateOnCompleted()))); - void ProcessIncomingNotification(Notification incomingNotification) + void ProcessIncomingNotification(System.Reactive.Notification incomingNotification) { try { diff --git a/src/DynamicData.Tests/Utilities/ObservableSpy.cs b/src/DynamicData.Tests/Utilities/ObservableSpy.cs index b4ae7bbc8..e44150ee5 100644 --- a/src/DynamicData.Tests/Utilities/ObservableSpy.cs +++ b/src/DynamicData.Tests/Utilities/ObservableSpy.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.InteropServices; -using System.Threading; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class ObservableSpy { diff --git a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs index eb9f4a490..fa315b2d8 100644 --- a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Diagnostics; -using System.Reactive.Concurrency; -using Bogus; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RandomizerExtensions { diff --git a/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs b/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs index 06168b009..618ec6922 100644 --- a/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs +++ b/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RawAnonymousObservable { diff --git a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs index 0567e5676..b5ad8a843 100644 --- a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs +++ b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RawAnonymousObserver { diff --git a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs index 4c7ce3a0e..e725b8340 100644 --- a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs +++ b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs @@ -1,19 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive; -using System.Threading.Tasks; - -using Microsoft.Reactive.Testing; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; // Using a custom implementing of IObserver<> to bypass normal RX safeguards, allowing invalid behaviors to be potentially tested for. public abstract class RecordingObserverBase : IObserver { private readonly TaskCompletionSource _whenFinalizedSource; - private readonly List>> _notifications; + private readonly List>> _notifications; private readonly IScheduler _scheduler; private Exception? _error; @@ -35,7 +27,7 @@ public bool HasCompleted public bool HasFinalized => _hasCompleted || (_error is not null); - public IReadOnlyList>> Notifications + public IReadOnlyList>> Notifications => _notifications; public Task WhenFinalized diff --git a/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs b/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs index 61c5b3445..ebeb037fe 100644 --- a/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs +++ b/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; /// /// see http://www.superstarcoders.com/blogs/posts/recursive-select-in-c-sharp-and-linq.aspx diff --git a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs index afe5f47d5..7614ae5fc 100644 --- a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs +++ b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class StressAddRemoveExtensions { diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index bdd440a1c..01b78fe49 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Kernel; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class TestSourceCache : ISourceCache diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index 6f3a1e2c2..70a885a20 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class TestSourceList : ISourceList diff --git a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs index 4994e2b35..8a3395f1e 100644 --- a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs +++ b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs @@ -1,7 +1,4 @@ -using System; -using System.Reactive; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public class UnsynchronizedNotificationException : Exception @@ -10,7 +7,7 @@ public UnsynchronizedNotificationException() : base("Unsynchronized notification received: Another notification is already being processed") { } - public required Notification IncomingNotification { get; init; } + public required System.Reactive.Notification IncomingNotification { get; init; } - public required Notification PriorNotification { get; init; } + public required System.Reactive.Notification PriorNotification { get; init; } } diff --git a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs index 51c53964d..a82caab33 100644 --- a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class ValueRecordingObserver : RecordingObserverBase diff --git a/src/DynamicData/Aggregation/AggregateEnumerator.cs b/src/DynamicData/Aggregation/AggregateEnumerator.cs index be9f93264..bbe34b5a6 100644 --- a/src/DynamicData/Aggregation/AggregateEnumerator.cs +++ b/src/DynamicData/Aggregation/AggregateEnumerator.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; - namespace DynamicData.Aggregation; internal sealed class AggregateEnumerator(IChangeSet source) : IAggregateChangeSet diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index c90e35520..ea41ebe79 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index f042bba71..739009045 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index 46a1f298b..02489497b 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index beb4d6e10..b0bb8e9b9 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 30599f9ec..80ded74e6 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index 12b0b3ca8..89f31ae7a 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; - namespace DynamicData.Alias; /// diff --git a/src/DynamicData/Attributes.cs b/src/DynamicData/Attributes.cs index dfb6a9e85..ffd8f519d 100644 --- a/src/DynamicData/Attributes.cs +++ b/src/DynamicData/Attributes.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Runtime.CompilerServices; - [assembly: InternalsVisibleTo("DynamicData.Tests")] [assembly: InternalsVisibleTo("DynamicData.ReactiveUI")] -[assembly: InternalsVisibleTo("DynamicData.Profile")] \ No newline at end of file +[assembly: InternalsVisibleTo("DynamicData.Profile")] diff --git a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs index e24b07843..99f0f9f1e 100644 --- a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs +++ b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Runtime.CompilerServices; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index 1cbe39d35..2b9990bb2 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 37a3e1739..907440143 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index 06cc41aff..3fe1afc56 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -3,10 +3,6 @@ // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; -using DynamicData.Cache.Internal; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindingListEventsSuspender.cs b/src/DynamicData/Binding/BindingListEventsSuspender.cs index 256d08fbe..b6f7dd2cd 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; - namespace DynamicData.Binding; internal sealed class BindingListEventsSuspender<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> : IDisposable diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index 1b5804bba..94a521074 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 47b241c96..6571d7398 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Linq; -using System.Reflection; - namespace DynamicData.Binding; internal static class ExpressionBuilder diff --git a/src/DynamicData/Binding/IObservableCollection.cs b/src/DynamicData/Binding/IObservableCollection.cs index 4358877b5..dbee19455 100644 --- a/src/DynamicData/Binding/IObservableCollection.cs +++ b/src/DynamicData/Binding/IObservableCollection.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.Specialized; -using System.ComponentModel; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index cf7d3a37a..721e57108 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index 3c3ac0924..f0b70f119 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/Observable.cs b/src/DynamicData/Binding/Observable.cs index 3e439d160..169d94846 100644 --- a/src/DynamicData/Binding/Observable.cs +++ b/src/DynamicData/Binding/Observable.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Binding; internal static class Observable diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 4715aba25..7eabe8658 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index 9b181ddeb..e7dc139e0 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index f99d9b9b4..2fe823071 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Reactive.Disposables; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index 4dd3fbd68..c7b3842f2 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.Binding; internal sealed class ObservablePropertyFactory diff --git a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs index c0e67dd3d..893b38c64 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.Concurrent; -using System.ComponentModel; -using System.Linq.Expressions; - namespace DynamicData.Binding; internal sealed class ObservablePropertyFactoryCache diff --git a/src/DynamicData/Binding/ObservablePropertyPart.cs b/src/DynamicData/Binding/ObservablePropertyPart.cs index 9b4b1ab09..3ee19280d 100644 --- a/src/DynamicData/Binding/ObservablePropertyPart.cs +++ b/src/DynamicData/Binding/ObservablePropertyPart.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reactive; - namespace DynamicData.Binding; [DebuggerDisplay("ObservablePropertyPart<{" + nameof(expression) + "}>")] diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index 0bb5fe208..b5665483c 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.cs @@ -2,13 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/SortAndBindOptions.cs b/src/DynamicData/Binding/SortAndBindOptions.cs index bf93e8afe..cc9e3eab4 100644 --- a/src/DynamicData/Binding/SortAndBindOptions.cs +++ b/src/DynamicData/Binding/SortAndBindOptions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index 81956791a..163448134 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -3,8 +3,6 @@ // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; namespace DynamicData.Binding; diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index 3230a9946..ecf3df403 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Cache; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/IPagedChangeSet.cs b/src/DynamicData/Cache/IPagedChangeSet.cs index 4fd88a798..272b3f4d5 100644 --- a/src/DynamicData/Cache/IPagedChangeSet.cs +++ b/src/DynamicData/Cache/IPagedChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 4494449a5..3f3c34b1f 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using DynamicData.Binding; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index be5e8d189..918525c73 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; [DebuggerDisplay("AnonymousObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 8699e1c58..1c64fbac5 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; #if SUPPORTS_ASYNC_DISPOSABLE @@ -105,4 +100,4 @@ void TryDisposeItem(TObject item) }); } } -#endif \ No newline at end of file +#endif diff --git a/src/DynamicData/Cache/Internal/AutoRefresh.cs b/src/DynamicData/Cache/Internal/AutoRefresh.cs index ee81fe581..be98d4d9a 100644 --- a/src/DynamicData/Cache/Internal/AutoRefresh.cs +++ b/src/DynamicData/Cache/Internal/AutoRefresh.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/BatchIf.cs b/src/DynamicData/Cache/Internal/BatchIf.cs index 76af20a61..019856b37 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class BatchIf(IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, bool initialPauseState = false, IObservable? intervalTimer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 0a882ad88..88a1e8e50 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; - namespace DynamicData.Cache.Internal; [DebuggerDisplay("Cache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] diff --git a/src/DynamicData/Cache/Internal/Cast.cs b/src/DynamicData/Cache/Internal/Cast.cs index 02f62ebb8..8dda73478 100644 --- a/src/DynamicData/Cache/Internal/Cast.cs +++ b/src/DynamicData/Cache/Internal/Cast.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Cast(IObservable> source, Func converter) diff --git a/src/DynamicData/Cache/Internal/ChangeSetCache.cs b/src/DynamicData/Cache/Internal/ChangeSetCache.cs index d63a93bea..1230a01f8 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetCache.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetCache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index c7734512d..2cef5aa4d 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index 0402b7b5f..89f31cf60 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DeferUntilLoaded diff --git a/src/DynamicData/Cache/Internal/DisposeMany.cs b/src/DynamicData/Cache/Internal/DisposeMany.cs index fe97f5c0e..27c94fbf6 100644 --- a/src/DynamicData/Cache/Internal/DisposeMany.cs +++ b/src/DynamicData/Cache/Internal/DisposeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DisposeMany(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/DistinctCalculator.cs b/src/DynamicData/Cache/Internal/DistinctCalculator.cs index 934f17ac3..8435b6088 100644 --- a/src/DynamicData/Cache/Internal/DistinctCalculator.cs +++ b/src/DynamicData/Cache/Internal/DistinctCalculator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DistinctCalculator(IObservable> source, Func valueSelector) diff --git a/src/DynamicData/Cache/Internal/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index 41c7e3a8d..3ddd59f9e 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/Internal/DynamicCombiner.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index cb4880193..8af6d620b 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; internal sealed class DynamicGrouper(Func? groupSelector = null) : IDisposable diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index f65df1b96..77e65e8a9 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 60bcd9de2..fdf338441 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class ExpireAfter diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index d128ada8f..c0ced0943 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class ExpireAfter diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 350ae272b..5b739d73f 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class Filter diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index e53a479bc..697b1ba73 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal static partial class Filter diff --git a/src/DynamicData/Cache/Internal/FilterImmutable.cs b/src/DynamicData/Cache/Internal/FilterImmutable.cs index 67f6ec02d..383a9f2d2 100644 --- a/src/DynamicData/Cache/Internal/FilterImmutable.cs +++ b/src/DynamicData/Cache/Internal/FilterImmutable.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FilterImmutable diff --git a/src/DynamicData/Cache/Internal/FilterOnObservable.cs b/src/DynamicData/Cache/Internal/FilterOnObservable.cs index d444d9ac4..acea546c4 100644 --- a/src/DynamicData/Cache/Internal/FilterOnObservable.cs +++ b/src/DynamicData/Cache/Internal/FilterOnObservable.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FilterOnObservable(IObservable> source, Func> filterFactory, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/FinallySafe.cs b/src/DynamicData/Cache/Internal/FinallySafe.cs index d4cb04523..4eba48a27 100644 --- a/src/DynamicData/Cache/Internal/FinallySafe.cs +++ b/src/DynamicData/Cache/Internal/FinallySafe.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FinallySafe(IObservable source, Action finallyAction) diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 46bdb663f..51b582c23 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index fd0936fe7..b667ed0b4 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) diff --git a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs index 0e11bc594..2e4001b8e 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnDynamic(IObservable> source, IObservable> selectGroupObservable, IObservable? regrouper = null) diff --git a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs index ba33db031..b69e62e4e 100644 --- a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnImmutable(IObservable> source, Func groupSelectorKey, IObservable? regrouper) diff --git a/src/DynamicData/Cache/Internal/GroupOnObservable.cs b/src/DynamicData/Cache/Internal/GroupOnObservable.cs index 0555004e1..d99929887 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnObservable(IObservable> source, Func> selectGroup) diff --git a/src/DynamicData/Cache/Internal/GroupOnProperty.cs b/src/DynamicData/Cache/Internal/GroupOnProperty.cs index 8fa06893b..5da904756 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index bc3755a44..fde66d748 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/IndexAndNode.cs b/src/DynamicData/Cache/Internal/IndexAndNode.cs index d80b66fd9..0f2237a21 100644 --- a/src/DynamicData/Cache/Internal/IndexAndNode.cs +++ b/src/DynamicData/Cache/Internal/IndexAndNode.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Cache.Internal; internal static class IndexAndNode diff --git a/src/DynamicData/Cache/Internal/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index e27c565c6..e48eb4bad 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class InnerJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/KeySelector.cs b/src/DynamicData/Cache/Internal/KeySelector.cs index 87127dfcb..920a01dd3 100644 --- a/src/DynamicData/Cache/Internal/KeySelector.cs +++ b/src/DynamicData/Cache/Internal/KeySelector.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Cache.Internal; internal sealed class KeySelector(Func keySelector) : IKeySelector diff --git a/src/DynamicData/Cache/Internal/KeyValueCollection.cs b/src/DynamicData/Cache/Internal/KeyValueCollection.cs index d743073f5..c3c59be34 100644 --- a/src/DynamicData/Cache/Internal/KeyValueCollection.cs +++ b/src/DynamicData/Cache/Internal/KeyValueCollection.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Cache.Internal; internal sealed class KeyValueCollection : IKeyValueCollection diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index f0709cb75..9897c383e 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index be539b82c..29e5a1737 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index ebf4b22f1..66dc74e4f 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index fe2eecc75..e7f739923 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; - namespace DynamicData.Cache.Internal; internal sealed class MergeMany diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index 551cc8bbf..9ac5bea53 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs index a49ad8223..deba5b48c 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index 26b85614b..d23324902 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class MergeManyItems diff --git a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs index bd7b18f4d..aba7ff362 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; -using DynamicData.List.Internal; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index 51ae8ac9d..d2f608696 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class ObservableWithValue diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index 17546116d..d8ac1b306 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class OfType(IObservable> source, bool suppressEmptyChangeSets) diff --git a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs index 092306f3d..47e9738b5 100644 --- a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs +++ b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class OnBeingRemoved(IObservable> source, Action removeAction) diff --git a/src/DynamicData/Cache/Internal/Page.cs b/src/DynamicData/Cache/Internal/Page.cs index e41595871..def1c94cf 100644 --- a/src/DynamicData/Cache/Internal/Page.cs +++ b/src/DynamicData/Cache/Internal/Page.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Page(IObservable> source, IObservable pageRequests) diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index 01828e85e..6b16bfcd9 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class QueryWhenChanged(IObservable> source, Func>? itemChangedTrigger = null) diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 4c4736391..414b9c7e3 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class RefCount(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs index 716d847d5..1194f5ef2 100644 --- a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs +++ b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Cache.Internal; /// Initializes a new instance of the class.Converts a to . diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 85163f75e..f00366dbe 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/SizeExpirer.cs b/src/DynamicData/Cache/Internal/SizeExpirer.cs index ede14bced..b1ed28955 100644 --- a/src/DynamicData/Cache/Internal/SizeExpirer.cs +++ b/src/DynamicData/Cache/Internal/SizeExpirer.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SizeExpirer diff --git a/src/DynamicData/Cache/Internal/Sort.cs b/src/DynamicData/Cache/Internal/Sort.cs index 11b39035e..75a1cc7e3 100644 --- a/src/DynamicData/Cache/Internal/Sort.cs +++ b/src/DynamicData/Cache/Internal/Sort.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Sort diff --git a/src/DynamicData/Cache/Internal/SortAndPage.cs b/src/DynamicData/Cache/Internal/SortAndPage.cs index 2d612a9b6..85dccf0ec 100644 --- a/src/DynamicData/Cache/Internal/SortAndPage.cs +++ b/src/DynamicData/Cache/Internal/SortAndPage.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; - namespace DynamicData.Cache.Internal; internal sealed class SortAndPage diff --git a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs index 44c6d3dc3..664a4a51e 100644 --- a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs +++ b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; - namespace DynamicData.Cache.Internal; internal sealed class SortAndVirtualize diff --git a/src/DynamicData/Cache/Internal/SortExtensions.cs b/src/DynamicData/Cache/Internal/SortExtensions.cs index c6275a358..7f011a7f9 100644 --- a/src/DynamicData/Cache/Internal/SortExtensions.cs +++ b/src/DynamicData/Cache/Internal/SortExtensions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - namespace DynamicData.Cache.Internal; internal static class SortExtensions diff --git a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs index 4ab732ceb..1c7d79ed4 100644 --- a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs +++ b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Binding; - namespace DynamicData.Cache.Internal; /* diff --git a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs index 863f2d6d6..23d33fb64 100644 --- a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs +++ b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SpecifiedGrouper(IObservable> source, Func groupSelector, IObservable> resultGroupSource) diff --git a/src/DynamicData/Cache/Internal/StatusMonitor.cs b/src/DynamicData/Cache/Internal/StatusMonitor.cs index 445074b63..0e577cbdf 100644 --- a/src/DynamicData/Cache/Internal/StatusMonitor.cs +++ b/src/DynamicData/Cache/Internal/StatusMonitor.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class StatusMonitor(IObservable source) diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 78579fbeb..410533b76 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SubscribeMany diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index 766f9f14a..4e32148f1 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class Switch(IObservable>> sources) diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index f3634dac3..b66ffcc25 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static class ToObservableChangeSet diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 47efd420c..d2ac7fa55 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class ToObservableOptional(IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index 0934d1061..672097a15 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index 803fed8cd..662480cf5 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; - namespace DynamicData.Cache.Internal; internal class TransformAsync( diff --git a/src/DynamicData/Cache/Internal/TransformImmutable.cs b/src/DynamicData/Cache/Internal/TransformImmutable.cs index 6090f034c..25c46de93 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformImmutable diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index f38853c08..abff1a3da 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -2,13 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Binding; - namespace DynamicData.Cache.Internal; internal sealed class TransformMany(IObservable> source, Func> manySelector, Func keySelector, Func>>? childChanges = null) diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index b202cb307..09accc411 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformManyAsync(IObservable> source, Func>>> transformer, IEqualityComparer? equalityComparer, IComparer? comparer, Action>? errorHandler = null) diff --git a/src/DynamicData/Cache/Internal/TransformOnObservable.cs b/src/DynamicData/Cache/Internal/TransformOnObservable.cs index b88e4f1c6..716ee93bc 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformOnObservable(IObservable> source, Func> transform, bool transformOnRefresh = false) diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index c7c95aa66..77720aea2 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index 322a50eb1..65c5498ac 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformWithInlineUpdate(IObservable> source, diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index bf379ef99..0dc5f52cb 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) diff --git a/src/DynamicData/Cache/Internal/TrueFor.cs b/src/DynamicData/Cache/Internal/TrueFor.cs index 28e036298..40c2400ca 100644 --- a/src/DynamicData/Cache/Internal/TrueFor.cs +++ b/src/DynamicData/Cache/Internal/TrueFor.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TrueFor(IObservable> source, Func> observableSelector, Func>, bool> collectionMatcher) diff --git a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs index 0c858419c..29b9b0a67 100644 --- a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs +++ b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class UniquenessEnforcer(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/Virtualise.cs b/src/DynamicData/Cache/Internal/Virtualise.cs index 9a5fefbcc..5d432fd40 100644 --- a/src/DynamicData/Cache/Internal/Virtualise.cs +++ b/src/DynamicData/Cache/Internal/Virtualise.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Virtualise(IObservable> source, IObservable virtualRequests) diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 44918b4c1..e6b54eecd 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index afce06cc6..8f840b2ca 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -1,16 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index f99f46747..dcf08e77d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index 07c984029..5d8a26ffc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index 3b217f6ed..bbfc41b26 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index bae09dd4e..4fa037e12 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 3a9f58875..f7dc2a411 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index 0a15843d5..d9a7ad694 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 1e7bfb428..666d8c8d9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index 39a04294e..211a7d768 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 1ed843deb..bb4b5e8f4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index e8733432c..811c3b934 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index ec591efa2..366d84241 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index c8d709c85..fc6ba0387 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index 90aa68b00..a323c4c75 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index 53dc96e5d..e1d35f839 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index d29301dc8..a04c091ef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 1f635fc58..a81ea6f3a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index eb46b86b3..a53b2c14c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index bf6d26c18..0f2a2320a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs index 47d11d3ca..7090cdcd5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index 89cebf0da..10bb5f406 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 52ad51274..96efafc58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 6007f055c..624f991d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index 86a68c29a..b0f3a803c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index f3ec6e103..30d6bed5d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 19699c8d2..1e267188c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index 168d8903e..48195e369 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index 7b43d0173..e2caceb02 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 3c4d432a7..bc4ade16c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index 82733f25a..b4092d340 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index b50111d6b..13953723d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index 23052c9e5..c7f0239c4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index 357b859ac..816b64525 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index fb23c04b6..fd97f6e6c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs index 02103498f..8fb3607db 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 9328527e2..2eea0dcb1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index c2e5894bc..3cd093fc2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index b803146d8..d12823bb9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index 31115d013..be77d0b08 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index 5165d4091..0623c6694 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index 2be1f5ca0..ac4f4d091 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index 1284a4b4f..5c2396e05 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index f5ff65ace..e0e16a9bb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 2b8f11a87..f16a71434 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index 2c1a2e020..59fff83a4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index 8a80e640d..7e35df4b5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 60bf2a343..694f7c9fe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index f19fde951..daec7b5a2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 5da9d2abe..45b3968a3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index 726ec5f1f..608aeec4a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index 810f118d0..d101e579d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index c29bd2a6b..5aefcdcd5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index b3c290d34..d4475526d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index 5fcbb9ed0..87d38125f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index b2581c6c8..5113dba7a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index 93abf0f92..2ed7aed71 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index a267d1511..c0a64f6a1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index dd12ae230..99348866d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index 00b222a68..6e0f2de35 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index 40e47a95b..b9aada93a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index 13441fd02..0fa10f48e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs index 6935103fe..48f94948a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index 464bbf29b..9982245df 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index a0de6f338..a9bb75871 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index 24d4d407e..0ab25dbc7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs index d5ce99d73..42943fc51 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index f294f119c..918ab4dc5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index 66c8315b5..8c4229e76 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 4e9947f28..6e419df01 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index d835ff00b..e91c7ccfb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs index 6e9f3ecd6..e3c24419e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index 837bf45f3..08b75df79 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 7bd66b375..ef2f9154a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index cb6a5a924..52cd89b8f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index 6a2ed2db4..297acf33a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index 87bccebe5..8c3af9f8a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 9f5e1444c..2340931cc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs index 2834f6084..00716f1db 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index 8960f03aa..4574809a6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index 560f53723..b752bb9d7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs index 4149907ba..b51f51bb1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs index 452c4ea0d..29c14dba6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index 9c5d06c9e..949fed69b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index 1871e4337..11e0b49d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index f04d2c998..8079110ad 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index 43d2c39eb..87d028eb8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs index 81770d625..da89b27ef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 8319591d0..d5bde1377 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 5e76e6cb8..f75af928b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index 940746e7a..856448c21 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index 682f5592d..f9eebd476 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index 4a6ac6005..248b088f2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index 5e9d2c062..2a17fbb62 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index 24d9e5e04..6051f4c95 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index f8e68385d..939869705 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 70477e563..a1fb64add 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index e0020280d..c7a0e6453 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index 99004fa73..b1a9f9a93 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index 965001488..d759890a2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs index a49b33f24..e0f3dd916 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs @@ -1,21 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs index e09acbedb..024d42371 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index f98e5270a..93c15b7c5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index 933529ea0..fc465cfc2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs index 2dbeaf1e6..0f6174c58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; -using DynamicData.Cache.Internal; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index 8cccf6088..16092e6c8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs index 50929fb3a..1fec4672b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs index 15c3196dc..6897195d7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index 9efbb2791..fb01d06c4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index b27e31c4f..8ce463a47 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index 095e1ec11..358d6ab62 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs index 7f9bf5bb6..93a9f96cd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs index 8b82b1943..43ccaf960 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index 76a0cb1f8..6fd6232c7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -2,20 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/PageContext.cs b/src/DynamicData/Cache/PageContext.cs index a36afc396..940a1ae7f 100644 --- a/src/DynamicData/Cache/PageContext.cs +++ b/src/DynamicData/Cache/PageContext.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Operators; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/PageResponse.cs b/src/DynamicData/Cache/PageResponse.cs index 425eb440e..7a317cc03 100644 --- a/src/DynamicData/Cache/PageResponse.cs +++ b/src/DynamicData/Cache/PageResponse.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/PagedChangeSet.cs b/src/DynamicData/Cache/PagedChangeSet.cs index f16135527..dfcdd9214 100644 --- a/src/DynamicData/Cache/PagedChangeSet.cs +++ b/src/DynamicData/Cache/PagedChangeSet.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Cache.Internal; -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/SortAndPageOptions.cs b/src/DynamicData/Cache/SortAndPageOptions.cs index 1783eced2..8d84e3e43 100644 --- a/src/DynamicData/Cache/SortAndPageOptions.cs +++ b/src/DynamicData/Cache/SortAndPageOptions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs index fa6843347..e231ffe8d 100644 --- a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs +++ b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/SortedChangeSet.cs b/src/DynamicData/Cache/SortedChangeSet.cs index fa9e37be0..8ec0c3284 100644 --- a/src/DynamicData/Cache/SortedChangeSet.cs +++ b/src/DynamicData/Cache/SortedChangeSet.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index 5d281579c..eea796994 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/Cache/SourceCache.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using DynamicData.Binding; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index dd2f6acbb..9f1724dfd 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - namespace DynamicData.Tests; /// diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 745bf27ae..695e298f6 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index 7711123f6..1a7309752 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - namespace DynamicData.Tests; /// diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index 42ff87a74..cb5fb0a45 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 70158e156..265d61edc 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index b972709a5..cef661043 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/VirtualChangeSet.cs b/src/DynamicData/Cache/VirtualChangeSet.cs index 3aae7f59f..e2009f834 100644 --- a/src/DynamicData/Cache/VirtualChangeSet.cs +++ b/src/DynamicData/Cache/VirtualChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Diagnostics/DiagnosticOperators.cs b/src/DynamicData/Diagnostics/DiagnosticOperators.cs index 0e13e735c..90dcac079 100644 --- a/src/DynamicData/Diagnostics/DiagnosticOperators.cs +++ b/src/DynamicData/Diagnostics/DiagnosticOperators.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Diagnostics; /// diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 1b45eb1b3..84613952d 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net462;net6.0;net7.0;net8.0;net9.0;net10.0 true @@ -12,8 +12,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData/DynamicDataOptions.cs b/src/DynamicData/DynamicDataOptions.cs index 4d0cececb..2d3ec4719 100644 --- a/src/DynamicData/DynamicDataOptions.cs +++ b/src/DynamicData/DynamicDataOptions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 124a4da30..3af9e9882 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData; /// diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index 69f7d3adc..de0724224 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/ISubjectWithRefCount.cs b/src/DynamicData/Experimental/ISubjectWithRefCount.cs index 3bf4d4eda..4e72c8cc2 100644 --- a/src/DynamicData/Experimental/ISubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/ISubjectWithRefCount.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Subjects; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index 0554eb718..e5b89d438 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Subjects; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 9825ae686..e80b214b3 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Experimental; internal sealed class Watcher : IWatcher diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 106e66aec..7cc74297a 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData; internal static class GlobalConfig diff --git a/src/DynamicData/Internal/Bitset.cs b/src/DynamicData/Internal/Bitset.cs index d28e4a669..d244b3844 100644 --- a/src/DynamicData/Internal/Bitset.cs +++ b/src/DynamicData/Internal/Bitset.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if NETCOREAPP3_0_OR_GREATER -using System.Numerics; #endif -using System.Runtime.CompilerServices; namespace DynamicData.Internal; diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 3a33143df..a5cc5ea24 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 9e3eaf4a0..e8a5ef413 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Kernel; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Internal/ObservableEx.cs b/src/DynamicData/Internal/ObservableEx.cs index 8fce9a875..81700210e 100644 --- a/src/DynamicData/Internal/ObservableEx.cs +++ b/src/DynamicData/Internal/ObservableEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; - namespace DynamicData.Internal; internal static class ObservableEx diff --git a/src/DynamicData/Internal/Rxx.cs b/src/DynamicData/Internal/Rxx.cs index 8fe86a561..26eca48d9 100644 --- a/src/DynamicData/Internal/Rxx.cs +++ b/src/DynamicData/Internal/Rxx.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. #if NET9_0_OR_GREATER -using DynamicData.Internal; namespace System.Reactive.Linq; diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 6eab28894..af3ec2a48 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Runtime.CompilerServices; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index ace8ed4a1..637fb9895 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Kernel/EnumerableIList.cs b/src/DynamicData/Kernel/EnumerableIList.cs index 242f83b67..807914f1c 100644 --- a/src/DynamicData/Kernel/EnumerableIList.cs +++ b/src/DynamicData/Kernel/EnumerableIList.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Diagnostics.CodeAnalysis; - // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. namespace DynamicData.Kernel; diff --git a/src/DynamicData/Kernel/EnumeratorIList.cs b/src/DynamicData/Kernel/EnumeratorIList.cs index 237ad591e..6adabc312 100644 --- a/src/DynamicData/Kernel/EnumeratorIList.cs +++ b/src/DynamicData/Kernel/EnumeratorIList.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. namespace DynamicData.Kernel; diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 68e6fa47d..05a6d8c34 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Kernel; /// diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index bbb23a052..116ed3e7c 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Kernel; /// diff --git a/src/DynamicData/Kernel/Optional.cs b/src/DynamicData/Kernel/Optional.cs index 0dbbd567f..a7dc27af0 100644 --- a/src/DynamicData/Kernel/Optional.cs +++ b/src/DynamicData/Kernel/Optional.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Kernel; /// diff --git a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs index 3f621f60b..b7f8c8711 100644 --- a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs +++ b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Kernel; internal sealed class ReadOnlyCollectionLight : IReadOnlyCollection diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index 90d8e3abc..3d8c22ff8 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData; /// diff --git a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs index 234b07930..68a6bfa95 100644 --- a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs +++ b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ChangeSetEx.cs b/src/DynamicData/List/ChangeSetEx.cs index 7abe7c5fa..cb10cfa95 100644 --- a/src/DynamicData/List/ChangeSetEx.cs +++ b/src/DynamicData/List/ChangeSetEx.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/IPageChangeSet.cs b/src/DynamicData/List/IPageChangeSet.cs index 447612a76..4fb245f1a 100644 --- a/src/DynamicData/List/IPageChangeSet.cs +++ b/src/DynamicData/List/IPageChangeSet.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 79051b1d6..a36b6b731 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; - namespace DynamicData.List.Internal; [DebuggerDisplay("AnonymousObservableList<{typeof(T).Name}> ({Count} Items)")] diff --git a/src/DynamicData/List/Internal/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index da2e4dc6a..4a0458e06 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index 8f7d1993c..2a9d457d3 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.List.Internal; internal sealed class BufferIf(IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, TimeSpan? timeOut = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/ClonedListChangeSet.cs b/src/DynamicData/List/Internal/ClonedListChangeSet.cs index 3b9996a1f..d0ffd153b 100644 --- a/src/DynamicData/List/Internal/ClonedListChangeSet.cs +++ b/src/DynamicData/List/Internal/ClonedListChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class ClonedListChangeSet diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 64882a3ba..3a1fbc015 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Cache.Internal; - namespace DynamicData.List.Internal; internal sealed class Combiner(ICollection>> source, CombineOperator type) diff --git a/src/DynamicData/List/Internal/DeferUntilLoaded.cs b/src/DynamicData/List/Internal/DeferUntilLoaded.cs index aae382472..17c23d61e 100644 --- a/src/DynamicData/List/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/List/Internal/DeferUntilLoaded.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class DeferUntilLoaded(IObservable> source) diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 046e19e4d..3a650817c 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class DisposeMany(IObservable> source) diff --git a/src/DynamicData/List/Internal/Distinct.cs b/src/DynamicData/List/Internal/Distinct.cs index 00ab3a458..f376f0d28 100644 --- a/src/DynamicData/List/Internal/Distinct.cs +++ b/src/DynamicData/List/Internal/Distinct.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Distinct(IObservable> source, Func valueSelector) diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index bb3091378..ca63dc23e 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Cache.Internal; - namespace DynamicData.List.Internal; internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 97a39c84e..d559175a1 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -1,13 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal sealed class ExpireAfter diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index 8d9b5e8dc..cdaffb1a2 100644 --- a/src/DynamicData/List/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/List/Internal/Filter.Dynamic.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index 48b12020c..3f4ff54d6 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index c9f04be4f..856c65948 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 1d2dae5e0..fa69449d7 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class FilterOnObservable(IObservable> source, Func> filter, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/FilterOnProperty.cs b/src/DynamicData/List/Internal/FilterOnProperty.cs index d73b8e238..148151e88 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; - namespace DynamicData.List.Internal; [Obsolete("Use AutoRefresh(), followed by Filter() instead")] diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index 23786400e..3eccf47b3 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class FilterStatic(IObservable> source, Func predicate) diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index 6ea7deccd..93d10cbc4 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelector, IObservable? regrouper) diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 2b4a08be8..557e84551 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnImmutable(IObservable> source, Func groupSelector, IObservable? reGrouper) diff --git a/src/DynamicData/List/Internal/GroupOnProperty.cs b/src/DynamicData/List/Internal/GroupOnProperty.cs index ab5998aed..2d69ac478 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index 99d8b1d75..5115dcdfd 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index c2ed74896..6ba40f046 100644 --- a/src/DynamicData/List/Internal/LimitSizeTo.cs +++ b/src/DynamicData/List/Internal/LimitSizeTo.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; #if NET9_0_OR_GREATER diff --git a/src/DynamicData/List/Internal/MergeChangeSets.cs b/src/DynamicData/List/Internal/MergeChangeSets.cs index 480c69b3a..ddf782d44 100644 --- a/src/DynamicData/List/Internal/MergeChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeChangeSets.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 65b238068..fcfa015f4 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.List.Internal; internal sealed class MergeMany(IObservable> source, Func> observableSelector) diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index 3b63ea231..293eaed52 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Cache.Internal; -using DynamicData.Internal; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 482c4f46b..27e9a9296 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Internal; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index c99b48d92..9d874b8e1 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemAdded diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index f12e68294..8d917f121 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemRefreshed diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index 178066bf2..cfe9d3e5e 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemRemoved diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index bd3238d2a..9eb7a12c2 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Pager(IObservable> source, IObservable requests) diff --git a/src/DynamicData/List/Internal/QueryWhenChanged.cs b/src/DynamicData/List/Internal/QueryWhenChanged.cs index ef58d4925..97e14c660 100644 --- a/src/DynamicData/List/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/List/Internal/QueryWhenChanged.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class QueryWhenChanged(IObservable> source) diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index b40036c3e..7a8eca543 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class RefCount(IObservable> source) diff --git a/src/DynamicData/List/Internal/Sort.cs b/src/DynamicData/List/Internal/Sort.cs index ff03e2e70..58c7c4296 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Sort(IObservable> source, IComparer? comparer, SortOptions sortOptions, IObservable? resort, IObservable>? comparerObservable, int resetThreshold) diff --git a/src/DynamicData/List/Internal/SubscribeMany.cs b/src/DynamicData/List/Internal/SubscribeMany.cs index 75075b04e..814a06107 100644 --- a/src/DynamicData/List/Internal/SubscribeMany.cs +++ b/src/DynamicData/List/Internal/SubscribeMany.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class SubscribeMany(IObservable> source, Func subscriptionFactory) diff --git a/src/DynamicData/List/Internal/Switch.cs b/src/DynamicData/List/Internal/Switch.cs index 9425771dd..fafc9b894 100644 --- a/src/DynamicData/List/Internal/Switch.cs +++ b/src/DynamicData/List/Internal/Switch.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Switch(IObservable>> sources) diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 8d1f853d2..d77b0e5ce 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -2,12 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal static class ToObservableChangeSet diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 31f45b1a4..fa0c0ee56 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class TransformAsync diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index d7bb2a69e..08d3cc0c1 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -1,14 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Binding; - namespace DynamicData.List.Internal; internal sealed class TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null, Func>>? childChanges = null) diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 69dbb11b2..9f8f81b6c 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Transformer diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index bb2f894c2..bf543760c 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Virtualiser(IObservable> source, IObservable requests) diff --git a/src/DynamicData/List/Linq/AddKeyEnumerator.cs b/src/DynamicData/List/Linq/AddKeyEnumerator.cs index 150c7c4a6..c5cdca423 100644 --- a/src/DynamicData/List/Linq/AddKeyEnumerator.cs +++ b/src/DynamicData/List/Linq/AddKeyEnumerator.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; internal sealed class AddKeyEnumerator(IChangeSet source, Func keySelector) : IEnumerable> diff --git a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs index 53c975d0a..f6bac1dad 100644 --- a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; internal sealed class ItemChangeEnumerator(IChangeSet changeSet) : IEnumerable> diff --git a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs index 4a8d0c352..3cfd2f68a 100644 --- a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - -using DynamicData.List.Internal; - namespace DynamicData.List.Linq; internal sealed class UnifiedChangeEnumerator(IChangeSet changeSet) : IEnumerable> diff --git a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs index 269bf2c2e..4d1e5f2a3 100644 --- a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs +++ b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; /// diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index 7035b1d4d..d076e4453 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 942d943c7..132861781 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 0ead13a87..e0b8007f4 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 2dee36d90..f1cb646dd 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index 478ae5b63..66b705eae 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index d5e0660f8..6be803cfd 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index dc3ede92c..6c6f40329 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index fe14bece5..b68667e90 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index 37224290f..c68efbaf1 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index 17ad6d43b..0620c8ce0 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index 7c0f9aad7..956588964 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index 4695297da..8ddecac85 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 2588c8927..677afa533 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index 13a617439..f5115688f 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -1,20 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index 4380c296d..ea0c75721 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index 1e6b5d037..f504e3591 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index ec463f21d..c3d757a06 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 39181d6c8..66ee27f14 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index 7c19912d8..ce8177b59 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs index 4df348372..f90afa1a5 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index 2165375b0..d176925c6 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index bd49bf1db..a92a6a592 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index b9b297d77..df58bdbeb 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 667a494ad..061cd411e 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index f4066e413..d97eb4043 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index f39760fac..f5a38fe87 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index 180c98ff6..396e5b61a 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index 4bf1bb98a..16ff0831b 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index dad726079..18645a8cb 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index b607a56f4..22ac020de 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index fd01dcfa6..8047a4c7c 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 4f58c05cc..ac0c6d39b 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index 55dfa4f19..02b5c056a 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index e10118cef..6b9a8b320 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index efc183cb6..44166bfdb 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index f07beed67..3ec73362b 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 53824aba0..68f0b22c3 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index 7a63f9247..b5be17e35 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index b47acd986..8e086f183 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index da8dc2c3d..de97c550a 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index d5431ff4a..670603251 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index 0e9984894..1cbd839e0 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index 4e8f03a10..9f2248cca 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index 9f0e434f7..bb2a020b3 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index 757954e35..d4ca24837 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index a7d50fbf0..ae98c7b46 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index c0c67e484..aa8331e8a 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 91c7100e0..973f33b06 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index 6f4745a2a..1256bb4c5 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs index ac040d07f..825e716a6 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index c4de93f57..a815886ec 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToCollection.cs b/src/DynamicData/List/ObservableListEx.ToCollection.cs index 072451c92..3ae810c60 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs index 1c465dddc..df70c50d7 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index 860079901..8af3dd536 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 17a128f99..ccab6b45e 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 64a856a24..b83a93b44 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index d130fa3b9..ae9eb3b07 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 6b3e3e327..bc6698046 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index a2d2ec09d..b1dcd50bc 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index a6529e3f3..087c12428 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 4a91bd035..2fc2d937b 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 0328218fc..1b9cc55f6 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index c2e61653d..f5e950b8c 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index aabb2b3c2..113412f9e 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index b63b5c6d0..77b42bd2a 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.cs b/src/DynamicData/List/ObservableListEx.cs index ffe07170a..7eb05ec7f 100644 --- a/src/DynamicData/List/ObservableListEx.cs +++ b/src/DynamicData/List/ObservableListEx.cs @@ -2,19 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/PageChangeSet.cs b/src/DynamicData/List/PageChangeSet.cs index c746ca0e3..46579a509 100644 --- a/src/DynamicData/List/PageChangeSet.cs +++ b/src/DynamicData/List/PageChangeSet.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/RangeChange.cs b/src/DynamicData/List/RangeChange.cs index 4abef195e..05e14cc2d 100644 --- a/src/DynamicData/List/RangeChange.cs +++ b/src/DynamicData/List/RangeChange.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 3db42bc11..afb973075 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -1,14 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 7c08529f8..29ac6df86 100644 --- a/src/DynamicData/List/SourceListEditConvenienceEx.cs +++ b/src/DynamicData/List/SourceListEditConvenienceEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index afac4458b..9ac030822 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/List/VirtualChangeSet.cs b/src/DynamicData/List/VirtualChangeSet.cs index 086490a36..30f372906 100644 --- a/src/DynamicData/List/VirtualChangeSet.cs +++ b/src/DynamicData/List/VirtualChangeSet.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index e9106b3e3..e87aaceef 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData; /// diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index f4aff797e..ff2ba961d 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -1,11 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Linq; - -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace namespace DynamicData.PLinq diff --git a/src/DynamicData/Platforms/net45/PSubscribeMany.cs b/src/DynamicData/Platforms/net45/PSubscribeMany.cs index 4c9e4be35..74106e2ba 100644 --- a/src/DynamicData/Platforms/net45/PSubscribeMany.cs +++ b/src/DynamicData/Platforms/net45/PSubscribeMany.cs @@ -1,10 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Disposables; -using System.Reactive.Linq; // ReSharper disable once CheckNamespace namespace DynamicData.PLinq diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index a9871c335..6798f0a06 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -1,9 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Linq; // ReSharper disable once CheckNamespace namespace DynamicData.PLinq diff --git a/src/DynamicData/Polyfills/RequiredMemberAttribute.cs b/src/DynamicData/Polyfills/RequiredMemberAttribute.cs index b1bbc836d..f0380799f 100644 --- a/src/DynamicData/Polyfills/RequiredMemberAttribute.cs +++ b/src/DynamicData/Polyfills/RequiredMemberAttribute.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. #if !NET7_0_OR_GREATER -using System.ComponentModel; namespace System.Runtime.CompilerServices; From f7232277f045effdec1da198b89e480dc29a4b0e Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Tue, 28 Jul 2026 09:02:38 -0700 Subject: [PATCH 2/5] Move the shared build settings into Directory.Build.props ImplicitUsings was set identically in all three projects, and nine namespaces were listed in all three Using blocks, so both now live in Directory.Build.props. Namespaces that only one or two projects need stay in the csproj that needs them, including the internals namespaces, since the benchmarks project has no InternalsVisibleTo and has no business importing them. Cleared out a few settings that were already covered: DynamicData.csproj repeated GenerateDocumentationFile, which the props file already sets, and IsPackable=true, which is the SDK default anyway. DynamicData.Benchmarks.csproj set IsPackable=false, which the props file already does for anything matching the benchmark or test naming, and PlatformTarget=AnyCPU, which is both the default and already covered by Platform in the props file. The benchmarks NoWarn was also missing its $(NoWarn) prefix, so it was quietly replacing the inherited list rather than adding to it. It happened to relist most of what it dropped, so nothing surfaced, but it was losing VSX1000 and CA1510. Now it appends. Verified against a clean build of main: identical set of 399 distinct warnings, no additions and no removals. Full suite still passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9582bb33-26d3-4aa5-8dd7-57dc55304680 --- src/Directory.Build.props | 14 ++++++++++++++ .../DynamicData.Benchmarks.csproj | 16 ++-------------- src/DynamicData.Tests/DynamicData.Tests.csproj | 10 ---------- src/DynamicData/DynamicData.csproj | 12 ------------ 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7d002a3bb..fe2e715dd 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -10,6 +10,7 @@ $(MSBuildProjectName.Contains('Tests')) $(MSBuildProjectName.Contains('Benchmarks')) embedded + enable Roland Pheasant Roland Pheasant Copyright (c) Roland Pheasant 2011-$([System.DateTime]::Now.ToString(yyyy)) @@ -36,6 +37,19 @@ true + + + + + + + + + + + + + false diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index e0679ad1d..4defdcacc 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -1,12 +1,9 @@ - + Exe net9.0 - AnyCPU - false - enable - ;1591;1701;1702;1705;CA1822;CA1001 + $(NoWarn);CA1822;CA1001 @@ -16,16 +13,7 @@ - - - - - - - - - diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index be55dbc34..d96a8af83 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -3,7 +3,6 @@ net9.0 $(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006 2.* - enable @@ -27,11 +26,9 @@ - - @@ -42,9 +39,7 @@ - - @@ -52,12 +47,7 @@ - - - - - diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 84613952d..ae908bc6e 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -1,10 +1,7 @@ netstandard2.0;net462;net6.0;net7.0;net8.0;net9.0;net10.0 - true true - true - enable @@ -12,32 +9,23 @@ - - - - - - - - - From 3ce188126ea2e5a1a6f7be73e04de0c33524cbd6 Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Tue, 28 Jul 2026 09:07:04 -0700 Subject: [PATCH 3/5] Document the usings convention in the repo instructions Now that the namespaces are declared in MSBuild, new code should not be adding using directives to source files, and there was nothing written down saying so. Adds a Usings and Namespaces section to copilot-instructions.md covering where the declarations live, how to add one, and why the four opt-in namespaces are the exception. Spelled out per namespace rather than as a blanket rule, because the reasons differ. Alias, PLinq and Aggregation shadow names that are already in scope, and PLinq is the sharp one: it provides Filter, Transform, TransformSafe and SubscribeMany under the same names as the core operators but with parallel implementations, so importing it globally would quietly swap the sequential operator for a parallel one everywhere. Experimental does not shadow anything, but the API is unstable, so a call site should have to opt in visibly. Also recorded the three name collisions that already bit us, so the next person qualifies the call site instead of pulling the namespace back into the file, and added a line to the maintenance checklist so this stays in sync with the csproj Using blocks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9582bb33-26d3-4aa5-8dd7-57dc55304680 --- .github/copilot-instructions.md | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 95d5c3c41..3dc64f65f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -67,6 +67,7 @@ These instruction files are living documentation. **They must be kept in sync wi - When an **operator's behavior changes**, update its table in the instruction file. - When a **new test utility** is added, update the test utilities reference in the main instructions and the appropriate `testing-*.instructions.md`. - When a **new domain type** is added to `Tests/Domain/`, add it to the Domain Types section. +- When a **namespace is added to or removed from** `Directory.Build.props` or a csproj `` block, update the Usings and Namespaces section. ## Repository Structure @@ -89,6 +90,48 @@ src/ │ └── Domain/ # Test domain types using Bogus fakers ``` +## Usings and Namespaces + +**Do not add `using` directives to source files.** Every project has `ImplicitUsings` enabled and declares its namespaces through `` items in MSBuild. New code should compile against the namespaces that are already in scope. + +Where the declarations live: + +| File | What it declares | +|---|---| +| `src/Directory.Build.props` | Namespaces every project needs: `DynamicData.Binding`, `DynamicData.Kernel`, `System.Reactive.Linq`, `System.Reactive.Disposables`, `System.Reactive.Subjects`, `System.Collections.ObjectModel`, `System.ComponentModel`, `System.Reflection`, `System.Runtime.CompilerServices` | +| `src/DynamicData/DynamicData.csproj` | The rest of what the library needs: `DynamicData.Cache`, `DynamicData.Internal`, `DynamicData.List.Internal`, `DynamicData.Operators`, `System.Numerics`, etc. | +| `src/DynamicData.Tests/DynamicData.Tests.csproj` | The rest of what the tests need: `Xunit`, `FluentAssertions`, `Bogus`, `DynamicData.Tests.Domain`, `DynamicData.Tests.Utilities`, etc. | +| `src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj` | The rest of what the benchmarks need: `BenchmarkDotNet.*`, `System.Collections.Immutable`, etc. | + +If you need a namespace that is not already global, add a `` to the project file that needs it. Put it in `Directory.Build.props` only when all three projects need it. Never add the `using` to the source file. + +Note that the internals namespaces (`DynamicData.Internal`, `DynamicData.Cache.Internal`) are declared in the library and the tests but deliberately not in the benchmarks project, which has no `InternalsVisibleTo`. + +### The exception: opt-in namespaces + +Four namespaces **must** stay as file-level `using` directives: + +| Namespace | Why it stays local | +|---|---| +| `DynamicData.Alias` | Provides `Select`, `SelectMany`, `SelectSafe`, `SelectTree` and `Where` as aliases for DynamicData operators. Importing it changes what LINQ-looking code means. | +| `DynamicData.PLinq` | Provides `Filter`, `Transform`, `TransformSafe` and `SubscribeMany` as *parallel* implementations under the same names as the core operators. Importing it silently swaps the sequential operator for a parallel one. | +| `DynamicData.Aggregation` | Provides `Count`, `Sum`, `Avg`, `Maximum`, `Minimum`, `StdDev` and friends, several of which overlap with Rx and LINQ names. | +| `DynamicData.Experimental` | Provides `AsWatcher`. Nothing shadows here, but the API is explicitly unstable, so a call site should have to opt in visibly. | + +The first three would change the behaviour of every file in the project if made global, without anything at the call site to signal it. A reader has to be able to see at the top of the file that `Transform` is the parallel version and not the ordinary one. + +If new code needs one of these, add the `using` to that file and only that file. + +### Name collisions + +Globalising namespaces can make a previously unambiguous name ambiguous. When that happens, qualify the call site or add a global alias. Do not solve it by moving the namespace back into the file. + +Cases already handled, so you do not trip over them again: + +- `Notification` exists in both `System.Reactive` and `DynamicData.Internal`. Test utilities that want the Rx one write `System.Reactive.Notification`. +- `ToHashSet()` is offered by both `DynamicData.Kernel.EnumerableEx` and `System.Linq.Enumerable`. Call `Enumerable.ToHashSet(...)` explicitly. +- `Bogus.Person` collides with `DynamicData.Tests.Domain.Person`. The tests project pins the name with ``, so a bare `Person` is always the domain type. Write `Bogus.Person` if you ever need the other one. + ## Operator Architecture Pattern Most operators follow the same two-part pattern: From 6d4de20239c87297db92405fc3aaa684fe057a42 Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Tue, 28 Jul 2026 20:08:38 -0700 Subject: [PATCH 4/5] Trim the usings section down It was three tables and eight paragraphs for what is one rule plus one exception. Cut it to about a third: dropped the table enumerating which namespace lives in which project file, since anyone who needs that can open the csproj and it was only going to go stale, and folded the collision notes into a single line. Also dropped the maintenance checklist entry I added with it, since it pointed at the enumeration that is now gone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9582bb33-26d3-4aa5-8dd7-57dc55304680 --- .github/copilot-instructions.md | 44 ++++++--------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3dc64f65f..7ba2cd095 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -67,7 +67,6 @@ These instruction files are living documentation. **They must be kept in sync wi - When an **operator's behavior changes**, update its table in the instruction file. - When a **new test utility** is added, update the test utilities reference in the main instructions and the appropriate `testing-*.instructions.md`. - When a **new domain type** is added to `Tests/Domain/`, add it to the Domain Types section. -- When a **namespace is added to or removed from** `Directory.Build.props` or a csproj `` block, update the Usings and Namespaces section. ## Repository Structure @@ -92,45 +91,18 @@ src/ ## Usings and Namespaces -**Do not add `using` directives to source files.** Every project has `ImplicitUsings` enabled and declares its namespaces through `` items in MSBuild. New code should compile against the namespaces that are already in scope. +**Do not add `using` directives to source files.** Every project has `ImplicitUsings` enabled and declares its namespaces as `` items: shared ones in `src/Directory.Build.props`, the rest in each csproj. If you need one that is not in scope, add it there rather than to the file. -Where the declarations live: +Four opt-in namespaces are the exception and **must** stay file-level: -| File | What it declares | +| Namespace | Why | |---|---| -| `src/Directory.Build.props` | Namespaces every project needs: `DynamicData.Binding`, `DynamicData.Kernel`, `System.Reactive.Linq`, `System.Reactive.Disposables`, `System.Reactive.Subjects`, `System.Collections.ObjectModel`, `System.ComponentModel`, `System.Reflection`, `System.Runtime.CompilerServices` | -| `src/DynamicData/DynamicData.csproj` | The rest of what the library needs: `DynamicData.Cache`, `DynamicData.Internal`, `DynamicData.List.Internal`, `DynamicData.Operators`, `System.Numerics`, etc. | -| `src/DynamicData.Tests/DynamicData.Tests.csproj` | The rest of what the tests need: `Xunit`, `FluentAssertions`, `Bogus`, `DynamicData.Tests.Domain`, `DynamicData.Tests.Utilities`, etc. | -| `src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj` | The rest of what the benchmarks need: `BenchmarkDotNet.*`, `System.Collections.Immutable`, etc. | +| `DynamicData.Alias` | Supplies `Select`, `Where` and `SelectMany` for changesets, so it changes what LINQ-looking code means. | +| `DynamicData.PLinq` | Supplies `Filter`, `Transform` and `SubscribeMany` under the *same names* as the core operators, but parallel. | +| `DynamicData.Aggregation` | Supplies `Count`, `Sum`, `Avg` and `Maximum`, which overlap Rx and LINQ names. | +| `DynamicData.Experimental` | Unstable API. Opting in should be visible at the call site. | -If you need a namespace that is not already global, add a `` to the project file that needs it. Put it in `Directory.Build.props` only when all three projects need it. Never add the `using` to the source file. - -Note that the internals namespaces (`DynamicData.Internal`, `DynamicData.Cache.Internal`) are declared in the library and the tests but deliberately not in the benchmarks project, which has no `InternalsVisibleTo`. - -### The exception: opt-in namespaces - -Four namespaces **must** stay as file-level `using` directives: - -| Namespace | Why it stays local | -|---|---| -| `DynamicData.Alias` | Provides `Select`, `SelectMany`, `SelectSafe`, `SelectTree` and `Where` as aliases for DynamicData operators. Importing it changes what LINQ-looking code means. | -| `DynamicData.PLinq` | Provides `Filter`, `Transform`, `TransformSafe` and `SubscribeMany` as *parallel* implementations under the same names as the core operators. Importing it silently swaps the sequential operator for a parallel one. | -| `DynamicData.Aggregation` | Provides `Count`, `Sum`, `Avg`, `Maximum`, `Minimum`, `StdDev` and friends, several of which overlap with Rx and LINQ names. | -| `DynamicData.Experimental` | Provides `AsWatcher`. Nothing shadows here, but the API is explicitly unstable, so a call site should have to opt in visibly. | - -The first three would change the behaviour of every file in the project if made global, without anything at the call site to signal it. A reader has to be able to see at the top of the file that `Transform` is the parallel version and not the ordinary one. - -If new code needs one of these, add the `using` to that file and only that file. - -### Name collisions - -Globalising namespaces can make a previously unambiguous name ambiguous. When that happens, qualify the call site or add a global alias. Do not solve it by moving the namespace back into the file. - -Cases already handled, so you do not trip over them again: - -- `Notification` exists in both `System.Reactive` and `DynamicData.Internal`. Test utilities that want the Rx one write `System.Reactive.Notification`. -- `ToHashSet()` is offered by both `DynamicData.Kernel.EnumerableEx` and `System.Linq.Enumerable`. Call `Enumerable.ToHashSet(...)` explicitly. -- `Bogus.Person` collides with `DynamicData.Tests.Domain.Person`. The tests project pins the name with ``, so a bare `Person` is always the domain type. Write `Bogus.Person` if you ever need the other one. +If globalising a namespace makes a name ambiguous, qualify the call site or add a global alias. Do not move the namespace back into the file. Already handled: `System.Reactive.Notification` against `DynamicData.Internal.Notification`, `Enumerable.ToHashSet` against `Kernel.EnumerableEx`, and `Person`, which the tests project aliases to the domain type so it wins over `Bogus.Person`. ## Operator Architecture Pattern From 0a42f890cf04a8a14829fe5017ee76f9bb16b54e Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Fri, 31 Jul 2026 16:34:38 -0700 Subject: [PATCH 5/5] Normalise encoding on the files this PR already touches UTF-8 with a byte order mark, CRLF, no trailing whitespace, final newline present. That is 75 files carrying trailing whitespace and one, the ToCollectionFixture that arrived with #1161, missing its byte order mark. Scoped to files already in this PR's diff, so the file count does not move. There are another 82 files in the solution missing a byte order mark and one missing its final newline, but this PR has no other reason to touch them and they belong in their own change. Checked that none of the affected files contain verbatim or raw string literals before trimming line ends, since trailing whitespace inside one of those would be significant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9582bb33-26d3-4aa5-8dd7-57dc55304680 --- .../Cache/ExpireAfter_Cache_ForSource.cs | 2 +- .../Cache/Filter_Cache_WithPredicateState.cs | 2 +- .../Cache/SortAndBindChange.cs | 4 +- .../List/ExpireAfter_List.cs | 2 +- ...lter_List_Static_RandomizedBoundedEdits.cs | 6 +- ...er_List_Static_RandomizedUnboundedEdits.cs | 4 +- .../List/Filter_List_WithPredicateState.cs | 4 +- src/DynamicData.Tests/AutoRefreshFilter.cs | 4 +- ...eeplyNestedNotifyPropertyChangedFixture.cs | 2 +- .../Binding/NotifyPropertyChangedExFixture.cs | 26 +-- ...ervableCollectionBindCacheSortedFixture.cs | 4 +- .../WhenPropertyChangedBehaviorFixture.cs | 4 +- ...syncDisposeManyFixture.IntegrationTests.cs | 6 +- .../AsyncDisposeManyFixture.UnitTests.cs | 10 +- .../Cache/AsyncDisposeManyFixture.cs | 2 +- .../Cache/AutoRefreshFixture.Base.cs | 102 ++++++------ ...AutoRefreshFixture.WithPropertyAccessor.cs | 8 +- ...oRefreshFixture.WithoutPropertyAccessor.cs | 6 +- .../Cache/AutoRefreshFixture.cs | 20 +-- .../AutoRefreshOnObservableFixture.Base.cs | 128 +++++++-------- .../AutoRefreshOnObservableFixture.WithKey.cs | 2 +- ...toRefreshOnObservableFixture.WithoutKey.cs | 2 +- .../Cache/AutoRefreshOnObservableFixture.cs | 26 +-- .../Cache/BatchIfWithTimeOutFixture.cs | 2 +- .../Cache/DisposeManyFixture.cs | 2 +- .../Cache/ExpireAfterFixture.ForSource.cs | 2 +- .../Cache/ExpireAfterFixture.ForStream.cs | 4 +- ...xture.DynamicPredicate.IntegrationTests.cs | 2 +- ...redicateAndReFiltering.IntegrationTests.cs | 2 +- ....DynamicPredicateState.IntegrationTests.cs | 2 +- src/DynamicData.Tests/Cache/FilterFixture.cs | 2 +- .../Cache/FromAsyncFixture.cs | 2 +- .../Cache/InnerJoinFixture.cs | 2 +- .../Cache/InnerJoinFixtureRaceCondition.cs | 2 +- .../Cache/MergeManyChangeSetsCacheFixture.cs | 2 +- .../Cache/ObservableChangeSetFixture.cs | 2 +- .../Cache/RightJoinFixture.cs | 2 +- .../Cache/SortAndBindFixture.cs | 10 +- .../Cache/SortAndBindObservableFixture.cs | 2 +- .../Cache/SortAndPageFixture.cs | 6 +- .../Cache/SortAndVirtualizeFixture.cs | 4 +- .../Cache/SourceCacheFixture.cs | 2 +- .../Cache/ToCollectionFixture.cs | 20 +-- ...ChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 6 +- ...geSetFixture.Sequences.IntegrationTests.cs | 2 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 6 +- .../Cache/TransformManyAsyncFixture.cs | 2 +- .../Cache/TransformOnObservableFixture.cs | 2 +- src/DynamicData.Tests/Domain/Market.cs | 2 +- .../EnumerableIListFixture.cs | 2 +- .../List/BatchIfWithTimeOutFixture.cs | 2 +- .../List/ChangeSetFixture.cs | 12 +- .../List/DisposeManyFixture.cs | 2 +- .../List/FilterFixture.Base.cs | 4 +- .../List/FilterFixture.Static.cs | 10 +- .../List/FilterFixture.WithPredicateState.cs | 8 +- .../List/OnItemAddedFixture.cs | 114 +++++++------- .../List/OnItemRefreshedFixture.cs | 114 +++++++------- .../List/OnItemRemovedFixture.cs | 148 +++++++++--------- src/DynamicData.Tests/List/SortFixture.cs | 2 +- ...ChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 28 ++-- ...geSetFixture.Sequences.IntegrationTests.cs | 2 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 6 +- .../List/TransformManyFixture.cs | 2 +- .../Utilities/CacheItemRecordingObserver.cs | 2 +- .../Utilities/FakeScheduler.cs | 4 +- .../Utilities/ListItemRecordingObserver.cs | 4 +- .../Utilities/ObservableExtensions.cs | 8 +- .../Utilities/ObservableSpy.cs | 4 +- .../Utilities/RawAnonymousObserver.cs | 4 +- .../Utilities/RecordingObserverBase.cs | 2 +- .../Utilities/TestSourceCache.cs | 4 +- .../Utilities/TestSourceList.cs | 10 +- 75 files changed, 486 insertions(+), 486 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs index cad902d57..262a72f10 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs @@ -71,7 +71,7 @@ public void RandomizedEditsAndExpirations() private void PerformRandomizedEdits(SourceCache source) { var randomizer = new Randomizer(1234567); - + var nextItemIndex = 0; for (var i = 0; i < _editCount; ++i) diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index baa3bab76..039a1ec0b 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -140,7 +140,7 @@ public static bool FilterByIdInclusionMask( int idInclusionMask, Item item) => ((item.Id & idInclusionMask) == 0) && item.IsIncluded; - + public required int Id { get; init; } public bool IsIncluded { get; set; } diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index de6afeac3..2a7efa484 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -34,7 +34,7 @@ public void SetUp() _newSubject = new Subject>(); _newSubjectOptimised = new Subject>(); - _cleanUp = new CompositeDisposable + _cleanUp = new CompositeDisposable ( _newSubject.SortAndBind(out var newList, _comparer).Subscribe(), _newSubjectOptimised.SortAndBind(out var optimisedList, _comparer, new SortAndBindOptions @@ -42,7 +42,7 @@ public void SetUp() InitialCapacity = Count, UseBinarySearch = true }).Subscribe(), - + _oldSubject.Sort(_comparer).Bind(out var oldList).Subscribe(), _oldSubjectOptimised.Sort(_comparer, SortOptimisations.ComparesImmutableValuesOnly).Bind(out var oldOptimisedList).Subscribe() ); diff --git a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs index d5930adaf..2429df785 100644 --- a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs +++ b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs @@ -93,7 +93,7 @@ public void RandomizedEditsAndExpirations() private void PerformRandomizedEdits(SourceList source) { var randomizer = new Randomizer(1234567); - + var nextItemIndex = 0; for (var i = 0; i < _editCount; ++i) diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 439f45160..5a33e9bf1 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -101,7 +101,7 @@ private static ImmutableArray> GenerateChangeSets( var changeSets = ImmutableArray.CreateBuilder>(initialCapacity: editCount); var items = new ChangeAwareList(); - + items.AddRange(Enumerable.Repeat(0, initialItemCount) .Select(_ => new Item() { @@ -110,7 +110,7 @@ private static ImmutableArray> GenerateChangeSets( }) .ToArray()); changeSets.Add(items.CaptureChanges()); - + while (changeSets.Count < changeSets.Capacity) { var changeCount = randomizer.Int(1, maxChangeCount); @@ -194,7 +194,7 @@ public class Item { public static bool FilterByIsIncluded(Item item) => item.IsIncluded; - + public required int Id { get; init; } public bool IsIncluded { get; set; } diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index 3f3a30eec..7aa494d11 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -103,7 +103,7 @@ private static ImmutableArray> GenerateChangeSets( var changeSets = ImmutableArray.CreateBuilder>(initialCapacity: editCount); var items = new ChangeAwareList(); - + while (changeSets.Count < changeSets.Capacity) { var changeCount = randomizer.Int(1, maxChangeCount); @@ -191,7 +191,7 @@ public class Item { public static bool FilterByIsIncluded(Item item) => item.IsIncluded; - + public required int Id { get; init; } public bool IsIncluded { get; init; } diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index dde27a14d..ba5040c94 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -13,7 +13,7 @@ public Filter_List_WithPredicateState() maxChangeCount: 20, maxRangeSize: 10, randomizer: randomizer); - + _predicateStates = GenerateRandomPredicateStates( valueCount: 5_000, randomizer: randomizer); @@ -217,7 +217,7 @@ public static bool FilterByIdInclusionMask( int idInclusionMask, Item item) => ((item.Id & idInclusionMask) == 0) && item.IsIncluded; - + public required int Id { get; init; } public bool IsIncluded { get; set; } diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index 3a644aad8..b13c84646 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -8,9 +8,9 @@ public void Bind_Transform_and_FilterOnObservable() var count = 3; var list = new SourceList(); list.AddRange(Enumerable.Range(1, count).Select(c => $"item {c}")); - + var bindedList = new ObservableCollectionExtended(); - + list.Connect() .FilterOnObservable(_ => Observable.Return(true)) .Transform(str => str) diff --git a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs index 6db977ac6..93fe86384 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -250,7 +250,7 @@ private void StressIt() var sw = new Stopwatch(); - // var factory = + // var factory = var myObservable = list.Connect().Do(_ => sw.Start()).WhenPropertyChanged(a => a!.Child!.Age, false).Do(_ => sw.Stop()).Subscribe(); diff --git a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs index 8aaa7af1f..eeaf7ac8e 100644 --- a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs +++ b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs @@ -89,7 +89,7 @@ public void SubscribeToValueChangeForAllItemsInList(bool notifyOnInitialValue) anotherPerson.Age = 13; lastAgeChange.Should().Be(13); } - + [Fact] public void CastToNullable() { @@ -98,30 +98,30 @@ public void CastToNullable() Id = 1, Age = 10 }; - + using var subscription = parent.WhenValueChanged( propertyAccessor: static entity => (int?)entity.Child.Age, notifyOnInitialValue: true, fallbackValue: static () => null) .RecordValues(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("additional changes could be made"); results.RecordedValues.Should().ContainSingle("an initial value should have been published"); results.RecordedValues[0].Should().Be(null, "the target entity has no child"); - + var child = new TestEntity() { Id = 2, Age = 5 }; parent.Child = child; - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("additional changes could be made"); results.RecordedValues.Skip(1).Should().ContainSingle("a single change was performed"); results.RecordedValues.Skip(1).First().Should().Be(child.Age, "a child of age 5 was added"); - + child.Age = 6; results.Error.Should().BeNull("no errors should have occurred"); @@ -129,26 +129,26 @@ public void CastToNullable() results.RecordedValues.Skip(2).Should().ContainSingle("a single change was performed"); results.RecordedValues.Skip(2).First().Should().Be(child.Age, "the child entity's age was changed"); } - + public class TestEntity : INotifyPropertyChanged { public long Id { get; init; } - + public int Age { get; set => SetPropertyField(ref field, value); } - + public TestEntity? Child { get; set => SetPropertyField(ref field, value); - } - + } + public event PropertyChangedEventHandler? PropertyChanged; - + protected void SetPropertyField( ref T field, T value, @@ -156,7 +156,7 @@ protected void SetPropertyField( { if (EqualityComparer.Default.Equals(field, value)) return; - + field = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs index 837a1b632..684aec434 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -88,8 +88,8 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() ReadOnlyObservableCollection list; //var list = new ObservableCollectionExtended(); - var binder = options == null - ? _source.Connect().Sort(_comparer).Bind(out list).Subscribe() + var binder = options == null + ? _source.Connect().Sort(_comparer).Bind(out list).Subscribe() : _source.Connect().Sort(_comparer).Bind(out list, options.Value).Subscribe(); using var listEvents = list.ObserveCollectionChanges().Take(1) diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs index 5dce37a51..e24ad0e5d 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs @@ -152,7 +152,7 @@ public void ExpressionContainsImplicitInterfaceCast() { Age = 10 }; - + using var subscription = ObserveAge(child) .RecordValues(out var results); @@ -170,7 +170,7 @@ static IObservable ObserveAge(T source) where T : IHasAge => source.WhenValueChanged(source => source.Age); } - + private interface IHasAge : INotifyPropertyChanged { diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 7b7f237fa..c99075218 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -19,7 +19,7 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp using var subscription = source .Connect() .TakeUntil(sourceCompletionSource) - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -77,7 +77,7 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite using var subscription = source .Connect() .TakeUntil(sourceCompletionSource) - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -132,7 +132,7 @@ public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() using var subscription = source .Connect() .TakeUntil(sourceCompletionSource) - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index a6e10cdc3..dd2a043a5 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -16,7 +16,7 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -115,7 +115,7 @@ public void ItemsAreRemoved_ItemsAreDisposedAfterDownstreamProcessing(ItemType i using var subscription = source .Connect() - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -176,7 +176,7 @@ public void ItemsAreUpdated_PreviousItemsAreDisposedAfterDownstreamProcessing(It using var subscription = source .Connect() - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -259,7 +259,7 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); @@ -313,7 +313,7 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source - .AsyncDisposeMany(disposalsCompleted => + .AsyncDisposeMany(disposalsCompleted => { disposalsCompletedResults.Should().BeNull("disposalsCompletedAccessor should only be invoked once per subscription"); disposalsCompleted.RecordValues(out disposalsCompletedResults); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs index 959042438..f37feae49 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs @@ -126,7 +126,7 @@ public ValueTask DisposeAsync() private readonly TaskCompletionSource _disposeCompletionSource = new(); - + private bool _hasBeenDisposed; } diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index d83c73af5..569c53b40 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -13,7 +13,7 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); var scheduler = new TestScheduler(); @@ -34,21 +34,21 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche // UUT Action (publish property change notification) ++item2.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "a buffer window expired"); results.RecordedChangeSets.Skip(1).First().Count.Should().Be(1, "1 item published a property change notification"); @@ -56,31 +56,31 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(1).First().First().Current.Should().Be(item2, "item #2 published a property change notification"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (publish property change notification) ++item1.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (publish additional property change notification) ++item3.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "a buffer window expired"); results.RecordedChangeSets.Skip(2).First().Count.Should().Be(2, "2 items published a property change notification"); @@ -91,7 +91,7 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche // UUT Action (normal refresh) source.Refresh(item2); - + // Normal refreshes should not be buffered results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed"); @@ -101,7 +101,7 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ItemIsAdded_SubscribesToPropertyChanged() { @@ -134,7 +134,7 @@ public void ItemIsAdded_SubscribesToPropertyChanged() item2.HasSubscriptions.Should().BeTrue("the PropertyChanged event should be subscribed to, for each added item"); item3.HasSubscriptions.Should().BeTrue("the PropertyChanged event should be subscribed to, for each added item"); } - + [Fact] public void ItemIsMoved_NotificationPropagates() { @@ -144,9 +144,9 @@ public void ItemIsMoved_NotificationPropagates() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + var items = new [] { item1, item2, item3 }; - + var initialChangeset = new ChangeSet() { new Change(reason: ChangeReason.Add, key: item1.Id, current: item1, index: 0), @@ -176,7 +176,7 @@ public void ItemIsMoved_NotificationPropagates() key: item3.Id, current: item3, currentIndex: 0, - previousIndex: 2) + previousIndex: 2) }); results.Error.Should().BeNull(); @@ -189,7 +189,7 @@ public void ItemIsMoved_NotificationPropagates() "an item was moved within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ItemIsRefreshed_NotificationPropagates() { @@ -199,9 +199,9 @@ public void ItemIsRefreshed_NotificationPropagates() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -234,9 +234,9 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -255,7 +255,7 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was removed from the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + item2.HasSubscriptions.Should().BeFalse("removing an item should trigger unsubscription from its reevaluator"); item1.HasSubscriptions.Should().BeTrue("the item was not removed from the source"); item3.HasSubscriptions.Should().BeTrue("the item was not removed from the source"); @@ -270,9 +270,9 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -292,13 +292,13 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was replaced within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + item2.HasSubscriptions.Should().BeFalse("replacing an item should trigger unsubscription from its reevaluator"); item4.HasSubscriptions.Should().BeTrue("adding an item should invoke its reevaluator and subscribe to it"); item1.HasSubscriptions.Should().BeTrue("the item was not removed from the source"); item3.HasSubscriptions.Should().BeTrue("the item was not removed from the source"); } - + [Fact] public void PropertyChangedOccurs_ItemRefreshes() { @@ -308,9 +308,9 @@ public void PropertyChangedOccurs_ItemRefreshes() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -343,7 +343,7 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); var scheduler = new TestScheduler(); @@ -364,7 +364,7 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl // UUT Action (publish property change notification) ++item2.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -378,7 +378,7 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "the throttle window ended"); results.RecordedChangeSets.Skip(1).First().Count.Should().Be(1, "1 item published property change notifications"); @@ -386,10 +386,10 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(1).First().First().Current.Should().Be(item2, "item #2 published property change notifications"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (publish property change notification) ++item2.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -398,21 +398,21 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); ++item2.Value; scheduler.AdvanceBy(1); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time to end of original throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window should have been extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(25).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "the throttle window ended"); results.RecordedChangeSets.Skip(2).First().Count.Should().Be(1, "1 item published property change notifications"); @@ -421,13 +421,13 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Theory] [InlineData(NotificationStrategy.Immediate)] [InlineData(NotificationStrategy.Asynchronous)] public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); // UUT Initialization & Action @@ -452,15 +452,15 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n [InlineData(NotificationStrategy.Asynchronous)] public void SourceCompletesWhenNotEmpty_CompletionDoesNotPropagate(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -484,17 +484,17 @@ public void SourceCompletesWhenNotEmpty_CompletionDoesNotPropagate(NotificationS [InlineData(NotificationStrategy.Asynchronous)] public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + var error = new Exception("Test"); - + // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -532,14 +532,14 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + var initialChangeset = new ChangeSet() { new Change(reason: ChangeReason.Add, key: item1.Id, current: item1), new Change(reason: ChangeReason.Add, key: item2.Id, current: item2), new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - + // UUT Initialization using var subscription = BuildUut(source.Prepend(initialChangeset)) .ValidateSynchronization() @@ -557,7 +557,7 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + source.HasObservers.Should().BeFalse("subscription disposal should propagate"); item1.HasSubscriptions.Should().BeFalse("subscription disposal should propagate"); item2.HasSubscriptions.Should().BeFalse("subscription disposal should propagate"); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs index b81fb7a2a..dff506c4d 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -12,7 +12,7 @@ public void PropertyAccessorIsNull_ThrowsException() propertyAccessor: (null as Expression>)!)) .Should() .Throw(); - + [Fact] public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotification() { @@ -22,9 +22,9 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -43,7 +43,7 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif results.RecordedChangeSets.Skip(1).Should().BeEmpty("the property change notification should have been ignored"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + protected override IObservable> BuildUut( IObservable> source, TimeSpan? changeSetBuffer = null, diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs index 04ba1f275..69b6e319f 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -14,9 +14,9 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -39,7 +39,7 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + protected override IObservable> BuildUut( IObservable> source, TimeSpan? changeSetBuffer = null, diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs index e0422d6f7..3937c4940 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs @@ -13,16 +13,16 @@ public class Item { public static int SelectId(Item item) => item.Id; - + public required int Id { get => _id; init => _id = value; } - + public bool HasSubscriptions => PropertyChanged is not null; - + public int OtherValue { get => _otherValue; @@ -30,13 +30,13 @@ public int OtherValue { if (_otherValue == value) return; - + _otherValue = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OtherValue))); } } - + public int Value { get => _value; @@ -44,20 +44,20 @@ public int Value { if (_value == value) return; - + _value = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value))); } } - + public event PropertyChangedEventHandler? PropertyChanged; - + public void RaiseAllPropertiesChanged() => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(string.Empty)); - + private readonly int _id; - + private int _otherValue; private int _value; } diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index a663cd9e1..18ffeeb7b 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -13,7 +13,7 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); var scheduler = new TestScheduler(); @@ -35,21 +35,21 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule // UUT Action (publish reevaluator notification) ++item2.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "a buffer window expired"); results.RecordedChangeSets.Skip(1).First().Count.Should().Be(1, "1 item published a reevaluator notification"); @@ -57,31 +57,31 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(1).First().First().Current.Should().Be(item2, "item #2 published a reevaluator notification"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (publish reevaluator notification) ++item1.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (publish additional reevaluator notification) ++item3.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "a buffer window expired"); results.RecordedChangeSets.Skip(2).First().Count.Should().Be(2, "2 items published a reevaluator notification"); @@ -92,7 +92,7 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule // UUT Action (normal refresh) source.Refresh(item2); - + // Normal refreshes should not be buffered results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed"); @@ -102,7 +102,7 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ItemIsAdded_SubscribesToReevaluator() { @@ -112,7 +112,7 @@ public void ItemIsAdded_SubscribesToReevaluator() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -137,7 +137,7 @@ public void ItemIsAdded_SubscribesToReevaluator() item2.HasObservers.Should().BeTrue("the reevaluator should be invoked and subscribed to, for each added item"); item3.HasObservers.Should().BeTrue("the reevaluator should be invoked and subscribed to, for each added item"); } - + [Fact] public void ItemIsMoved_NotificationPropagates() { @@ -147,9 +147,9 @@ public void ItemIsMoved_NotificationPropagates() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + var items = new[] { item1, item2, item3 }; - + var initialChangeset = new ChangeSet() { new Change(reason: ChangeReason.Add, key: item1.Id, current: item1, index: 0), @@ -181,7 +181,7 @@ public void ItemIsMoved_NotificationPropagates() key: item3.Id, current: item3, currentIndex: 0, - previousIndex: 2) + previousIndex: 2) }); results.Error.Should().BeNull(); @@ -194,7 +194,7 @@ public void ItemIsMoved_NotificationPropagates() "an item was moved within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ItemIsRefreshed_NotificationPropagates() { @@ -204,11 +204,11 @@ public void ItemIsRefreshed_NotificationPropagates() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + var reevaluatorInvocationCount = 0; - + // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -251,9 +251,9 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -274,7 +274,7 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was removed from the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + item2.HasObservers.Should().BeFalse("removing an item should trigger unsubscription from its reevaluator"); item1.HasObservers.Should().BeTrue("the item was not removed from the source"); item3.HasObservers.Should().BeTrue("the item was not removed from the source"); @@ -289,9 +289,9 @@ public void ItemIsUpdated_ReInvokesReevaluator() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -313,15 +313,15 @@ public void ItemIsUpdated_ReInvokesReevaluator() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was replaced within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + item2.HasObservers.Should().BeFalse("replacing an item should trigger unsubscription from its reevaluator"); item4.HasObservers.Should().BeTrue("adding an item should invoke its reevaluator and subscribe to it"); item1.HasObservers.Should().BeTrue("the item was not removed from the source"); item3.HasObservers.Should().BeTrue("the item was not removed from the source"); - + // UUT Action (updated item publishes reevaluator notification) ++item4.Value; - + results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "1 item published a reevaluation notification"); results.RecordedChangeSets.Skip(2).First().Count.Should().Be(1, "1 item published a reevaluation notification"); @@ -330,21 +330,21 @@ public void ItemIsUpdated_ReInvokesReevaluator() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Theory] [InlineData(NotificationStrategy.Immediate)] [InlineData(NotificationStrategy.Asynchronous)] public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSourceCompletionAndOtherReevaluatorCompletions(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization & Action (initial completion) if (notificationStrategy is NotificationStrategy.Immediate) item2.Complete(); @@ -371,7 +371,7 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + // UUT Action (source completion) source.Complete(); @@ -379,19 +379,19 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all notification sources have completed"); } - + [Theory] [InlineData(NotificationStrategy.Immediate)] [InlineData(NotificationStrategy.Asynchronous)] public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCompletion(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); using var item = new Item() { Id = 1 }; - + source.AddOrUpdate(item); - + // UUT Initialization & Action (reevaluator completion) if (notificationStrategy is NotificationStrategy.Immediate) item.Complete(); @@ -418,7 +418,7 @@ public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCom results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all notification sources have completed"); } - + [Fact] public void ReevaluatorEmitsAsynchronously_ItemRefreshes() { @@ -428,9 +428,9 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -455,7 +455,7 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact(Skip = "Existing defect, #1099")] public void ReevaluatorEmitsImmediately_ItemDoesNotRefresh() { @@ -465,9 +465,9 @@ public void ReevaluatorEmitsImmediately_ItemDoesNotRefresh() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization & Action using var subscription = BuildUut( source: source.Connect(), @@ -482,23 +482,23 @@ public void ReevaluatorEmitsImmediately_ItemDoesNotRefresh() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Theory(Skip = "Existing defect. Docs say that ignoring reevaluator exceptions is intentional, but it shouldn't be. Basic RX philosophy is that exceptions should basically always propagate.")] [InlineData(NotificationStrategy.Immediate)] [InlineData(NotificationStrategy.Asynchronous)] public void ReevaluatorFails_ErrorPropagates(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + var error = new Exception("Test"); - + // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) item2.SetError(error); @@ -522,11 +522,11 @@ public void ReevaluatorFails_ErrorPropagates(NotificationStrategy notificationSt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); } } - + [Fact(Skip = "Existing defect. Docs say that ignoring reevaluator exceptions is intentional, but it shouldn't be. Basic RX philosophy is that exceptions should basically always propagate.")] public void ReevaluatorThrows_ExceptionPropagates() { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); var error = new Exception("Test"); @@ -550,13 +550,13 @@ public void ReevaluatorThrows_ExceptionPropagates() results.Error.Should().Be(error, "upstream errors should propagate downstream"); results.RecordedChangeSets.Should().BeEmpty("an error occurred during processing of the initial changeset"); } - + [Theory] [InlineData(NotificationStrategy.Immediate)] [InlineData(NotificationStrategy.Asynchronous)] public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); // UUT Initialization & Action @@ -583,15 +583,15 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n [InlineData(NotificationStrategy.Asynchronous)] public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -632,17 +632,17 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions [InlineData(NotificationStrategy.Asynchronous)] public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrategy) { - // Setup + // Setup using var source = new TestSourceCache(Item.SelectId); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + source.AddOrUpdate(new[] { item1, item2, item3 }); - + var error = new Exception("Test"); - + // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -684,14 +684,14 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - + var initialChangeset = new ChangeSet() { new Change(reason: ChangeReason.Add, key: item1.Id, current: item1), new Change(reason: ChangeReason.Add, key: item2.Id, current: item2), new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - + // UUT Initialization using var subscription = BuildUut( source: source.Prepend(initialChangeset), @@ -711,7 +711,7 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - + source.HasObservers.Should().BeFalse("subscription disposal should propagate"); item1.HasObservers.Should().BeFalse("subscription disposal should propagate"); item2.HasObservers.Should().BeFalse("subscription disposal should propagate"); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs index 0518bd2f0..421c57850 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -12,7 +12,7 @@ public void ReevaluatorIsNull_ThrowsException() reevaluator: (null as Func>)!)) .Should() .Throw(); - + protected override IObservable> BuildUut( IObservable> source, Func> reevaluator, diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs index e5f5eeab3..36b7ba7df 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -12,7 +12,7 @@ public void ReevaluatorIsNull_ThrowsException() reevaluator: (null as Func>)!)) .Should() .Throw(); - + protected override IObservable> BuildUut( IObservable> source, Func> reevaluator, diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index a0b546e80..045e69acc 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -17,25 +17,25 @@ public static IObservable ObserveValue(Item item) observer.OnNext(item._value); return item._valueChanged.SubscribeSafe(observer); }); - + public static IObservable ObserveValueChanged(Item item) => item._valueChanged.Select(static _ => Unit.Default); - + public static int SelectId(Item item) => item.Id; - + public Item() => _valueChanged = new(); - + public required int Id { get => _id; init => _id = value; } - + public bool HasObservers => _valueChanged.HasObservers; - + public int Value { get => _value; @@ -43,30 +43,30 @@ public int Value { if (_value == value) return; - + _value = value; _valueChanged.OnNext(value); } } - + public void Complete() => _valueChanged.OnCompleted(); - + public void Dispose() { if (Interlocked.Exchange(ref _hasDisposed, true)) return; - + _valueChanged.OnCompleted(); _valueChanged.Dispose(); } - + public void SetError(Exception error) => _valueChanged.OnError(error); - + private readonly int _id; private readonly Subject _valueChanged; - + private bool _hasDisposed; private int _value; } diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 12c766a1a..07202ada4 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -204,7 +204,7 @@ public void WillApplyTimeout() { _pausingSubject.OnNext(true); - //should timeout + //should timeout _scheduler.AdvanceBy(TimeSpan.FromSeconds(61).Ticks); _source.AddOrUpdate(new Person("A", 1)); diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index a9dd01fb9..6bfc7a2c2 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -132,7 +132,7 @@ public void RemainingItemsAreDisposedAfterCompleted() public void RemainingItemsAreDisposedAfterError() { _itemsSource.AddOrUpdate(new DisposableObject(1)); - + var error = new Exception("Test Exception"); _changeSetsSource.OnError(error); diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index f55431f24..b250f2232 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -660,7 +660,7 @@ private static void PerformStressEdits( }; var randomizer = new Randomizer(1234567); - + var items = Enumerable.Range(1, editCount * maxChangeCount) .Select(id => new StressItem() { diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index 189a84466..90409b307 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -942,7 +942,7 @@ private static void PublishStressChangeSets( foreach(var changeSet in changeSets) source.OnNext(changeSet); } - + private static async Task WaitForCompletionAsync( CacheItemRecordingObserver results, TimeSpan timeout) @@ -957,7 +957,7 @@ private static async Task WaitForCompletionAsync( await Task.Delay(pollingInterval); // Identify "completion" as either an error, a completion signal, or all expiring items being removed. - if ((results.Error is not null) + if ((results.Error is not null) || results.HasCompleted || results.RecordedItemsByKey.Values.All(static item => item.Lifetime is null)) { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index e63d2bc4f..16ab0a822 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -17,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 7bb4b9832..29d323d3e 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -17,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index c4c21028d..7246cd240 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -17,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicateStates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) diff --git a/src/DynamicData.Tests/Cache/FilterFixture.cs b/src/DynamicData.Tests/Cache/FilterFixture.cs index 22b7b18a5..8c0334eca 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.cs @@ -30,7 +30,7 @@ public static bool FilterByIdInclusionMask( public static int SelectId(Item item) => item.Id; - + public required int Id { get; init; } public bool IsIncluded { get; set; } diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index c504b7389..ade5a5847 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -52,7 +52,7 @@ Task> Loader() var data2 = Observable.FromAsync(Loader).ToObservableChangeSet(p => p.Key).AsObservableCache().Connect().Subscribe(changes => { }, ex => error = ex); //var subscribed = data.Connect() - // + // error.Should().NotBeNull(); } diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs index 8cde6f517..308fdc0d5 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -281,7 +281,7 @@ public void MoreRight() innerCache => { innerCache.AddOrUpdate(new DeviceMetaData(1,"Device1")); - innerCache.AddOrUpdate(new DeviceMetaData(2,"Device2")); + innerCache.AddOrUpdate(new DeviceMetaData(2,"Device2")); innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); innerCache.AddOrUpdate(new DeviceMetaData(4,"Device4")); }); diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index 4e9dc3b3d..8f3aad4d7 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -26,7 +26,7 @@ public void LetsSeeWhetherWeCanRandomlyHitARaceCondition() ids.InnerJoin(itemsCache.Connect(), x => x.Id, (_, thing) => thing).Subscribe((z) => { }, ex => { }, () => { }); } - // See https://github.com/reactivemarbles/DynamicData/issues/787 + // See https://github.com/reactivemarbles/DynamicData/issues/787 [Fact] public void LetsSeeWhetherWeCanRandomlyHitADifferentRaceCondition() { diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index b0493f63b..9c2538612 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -811,7 +811,7 @@ public void OrderOfChangesIsPreserved(bool removeFirst) var markets2 = Enumerable.Range(0, MarketCount).Select(n => new Market(n)).ToArray(); AddUniquePrices(markets2); using var results = _marketCache.Connect().MergeManyChangeSets(m => m.LatestPrices, MarketPrice.EqualityComparer).AsAggregator(); - (var firstReason, var nextReason, int expectedChanges) = removeFirst + (var firstReason, var nextReason, int expectedChanges) = removeFirst ? (ChangeReason.Remove, ChangeReason.Add, 2 * MarketCount * PricesPerMarket) : (ChangeReason.Add, ChangeReason.Remove, 3 * MarketCount * PricesPerMarket); diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 7cfd02bc3..b855721d7 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -27,7 +27,7 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() * but periodically fails when all tests are run. WTAF - I have no idea why but can only speculate * that without it the context is returning to the context of the test runner and it doesn't get back to it * until after the test session ends - */ + */ await Task.Delay(5, token).ConfigureAwait(false); } }, diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index 61ed56244..62a5f9772 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -297,7 +297,7 @@ public void MoreRight() innerCache => { innerCache.AddOrUpdate(new DeviceMetaData(1,"Device1")); - innerCache.AddOrUpdate(new DeviceMetaData(2,"Device2")); + innerCache.AddOrUpdate(new DeviceMetaData(2,"Device2")); innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); innerCache.AddOrUpdate(new DeviceMetaData(4,"Device4")); }); diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index f32c5ae4e..2ab7c306a 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -148,7 +148,7 @@ public sealed class SortAndBindWithResetOptions: IDisposable public void FiresResetWhenThresholdIsMet() { var options = new SortAndBindOptions { ResetThreshold = 10 }; - + using var sorted = _source.Connect().SortAndBind(out var list, _comparer, options).Subscribe(); using var collectionChangedEvents = list.ObserveCollectionChanges().Select(e => e.EventArgs).Subscribe(_collectionChangedEventArgs.Add); @@ -195,7 +195,7 @@ public void NeverFireReset() _source.AddOrUpdate(Enumerable.Range(10, 15).Select(i => new Person($"P{i}", i))); _collectionChangedEventArgs.Count.Should().Be(15); _collectionChangedEventArgs.All(a => a.Action == NotifyCollectionChangedAction.Add).Should().BeTrue(); - + list.Count.Should().Be(20); } @@ -298,7 +298,7 @@ public void InsertAtEnd() _source.AddOrUpdate(toInsert); _boundList.Count.Should().Be(101); - + var last = _boundList[^1]; last.Should().Be(toInsert); @@ -534,7 +534,7 @@ public void SortInitialBatch() { var people = _generator.Take(100).ToArray(); _source.AddOrUpdate(people); - + _boundList.Count.Should().Be(100); people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -552,7 +552,7 @@ public void UpdateFirst() _source.AddOrUpdate(new Person(toUpdate.Name, toUpdate.Age + 5)); people[IndexFromKey(update.Key)] = new Person(toUpdate.Name, toUpdate.Age + 5); - + int IndexFromKey(string key) => people.FindIndex(p => p.Key == key); people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index 78ae06731..3cf998738 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -74,7 +74,7 @@ public void ChangeSort() // change to oldest first sort ComparerObservable.OnNext(_oldestComparer); - + var oldestFirst = people.OrderBy(p => p, _oldestComparer).ToList(); _boundList.SequenceEqual(oldestFirst).Should().BeTrue(); diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index ef4597c11..ffec59692 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -26,7 +26,7 @@ public void ChangeComparer() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - // change the comparer + // change the comparer _comparerSubject.OnNext(_descComparer); Aggregator.Messages.Cast>>().LastOrDefault().Context.Comparer.Should().Be(_descComparer); @@ -39,7 +39,7 @@ public void ChangeComparer() public void ChangeComparerWithOnlyOnePage() { PageRequests.OnNext(new PageRequest(page: 1, size: 200)); - + var people = Enumerable.Range(1, 100).Select(i => new Person($"P{i:000}", i)).OrderBy(p => Guid.NewGuid()); Source.AddOrUpdate(people); @@ -49,7 +49,7 @@ public void ChangeComparerWithOnlyOnePage() actualResult.Should().BeEquivalentTo(expectedResult); var changesetCount = Aggregator.Messages.Count; - // change the comparer + // change the comparer _comparerSubject.OnNext(_descComparer); Aggregator.Messages.Cast>>().LastOrDefault().Context.Comparer.Should().Be(_descComparer); diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index 58e5befe4..a4fae8d97 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -26,7 +26,7 @@ public void ChangeComparer() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - // change the comparer + // change the comparer _comparerSubject.OnNext(_descComparer); expectedResult = people.OrderBy(p => p, _descComparer).Take(25).ToList(); @@ -47,7 +47,7 @@ public void ChangeComparerDataSetSmallerThanVirtualSize() Aggregator.Messages[0].All(c => c.Reason == ChangeReason.Add).Should().BeTrue(); - // change the comparer + // change the comparer _comparerSubject.OnNext(_descComparer); expectedResult = people.OrderBy(p => p, _descComparer).Take(10).ToList(); diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs index 760d9b7f1..a58afab25 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs @@ -153,7 +153,7 @@ public void EmptyChangesWithFilter() public void StaticFilterRemove() { var cache = new SourceCache(x => x.Id); - + var above5 = cache.Connect(x => x.Value > 5).AsObservableCache(); var below5 = cache.Connect(x => x.Value <= 5).AsObservableCache(); diff --git a/src/DynamicData.Tests/Cache/ToCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs index a764f12de..fafdd19d4 100644 --- a/src/DynamicData.Tests/Cache/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs @@ -1,4 +1,4 @@ -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ToCollectionFixture { @@ -9,9 +9,9 @@ public record TestItem { public static int SelectId(TestItem item) => item.Id; - + public required int Id { get; init; } - + public int Version { get; init; } } @@ -27,7 +27,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() using var subscription = source.Connect() .ToCollection() .RecordValues(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); // TODO: Disabled due to existing defect. Fix and restore. //results.RecordedValues.Should().ContainSingle("an initial snapshot should always be published"); @@ -36,7 +36,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() // TODO: Disabled due to existing defect. Fix and restore. //priorResults.Add(results.RecordedValues[^1].ToArray()); - + // UUT Action (add items) source.AddOrUpdate(new[] { @@ -44,7 +44,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() new TestItem() { Id = 2 }, new TestItem() { Id = 3 } }); - + results.Error.Should().BeNull("no errors should have occurred"); results.RecordedValues.Skip(priorResults.Count).Should().ContainSingle("a single source operation was performed"); results.RecordedValues[^1].Should().BeEquivalentTo(source.Items, "snapshots should always match the source collection"); @@ -54,7 +54,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() result.Should().BeEquivalentTo(priorResult, "previous snapshots should not be mutated"); priorResults.Add(results.RecordedValues[^1].ToArray()); - + // UUT Action (replace items) source.AddOrUpdate(new[] { @@ -62,7 +62,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() new TestItem() { Id = 2, Version = 1 }, new TestItem() { Id = 3, Version = 1 } }); - + results.Error.Should().BeNull("no errors should have occurred"); results.RecordedValues.Skip(priorResults.Count).Should().ContainSingle("a single source operation was performed"); results.RecordedValues[^1].Should().BeEquivalentTo(source.Items, "snapshots should always match the source collection"); @@ -75,7 +75,7 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() // UUT Action (remove items) source.RemoveKeys(source.Keys.ToArray()); - + results.Error.Should().BeNull("no errors should have occurred"); results.RecordedValues.Skip(priorResults.Count).Should().ContainSingle("a single source operation was performed"); results.RecordedValues[^1].Should().BeEquivalentTo(source.Items, "snapshots should always match the source collection"); @@ -150,7 +150,7 @@ public void WhenSourceIsNull_ThrowsException() .Should().Throw() .WithParameterName("source") .Which; - + _output.WriteLine(result.ToString()); } diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 40fbe0836..c1bac313a 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -39,7 +39,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( .ValidateSynchronization() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results1); - + using var subscription2 = Observable.Interval( period: TimeSpan.FromMilliseconds(5), scheduler: scheduler) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 5c815790f..d116eae5f 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -165,7 +165,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -220,7 +220,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -465,7 +465,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var error = new Exception("Test Exception"); var source = sourceType switch - { + { SourceType.Asynchronous => new Subject(), SourceType.Immediate => Observable.Throw(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 9aef8f2a3..0c85963fd 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -42,7 +42,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( .ValidateSynchronization() .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results1); - + using var subscription2 = Observable.Interval( period: TimeSpan.FromMilliseconds(5), scheduler: scheduler) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 57cd86013..64fd23287 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -176,7 +176,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -236,7 +236,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -427,7 +427,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var error = new Exception("Test Exception"); var source = sourceType switch - { + { SourceType.Asynchronous => new Subject>(), SourceType.Immediate => Observable.Throw>(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) diff --git a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs index 284610236..3788fc544 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -210,7 +210,7 @@ private AnimalOwner CreateWithSameId(AnimalOwner original) sameId.Animals.AddRange(newOwner.Animals.Items); return sameId; } - + private static void CheckResultContents(IEnumerable owners, ChangeSetAggregator ownerResults, ChangeSetAggregator animalResults, Func keySelector, IComparer comparer) where T : notnull { diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index d43c026ca..27c16ad40 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -163,7 +163,7 @@ public void OrderOfChangesIsPreserved(bool removeFirst) { // Arrange using var results = _animalCache.Connect().TransformOnObservable(Observable.Return).AsAggregator(); - (var firstReason, var nextReason, var expectedChanges) = removeFirst + (var firstReason, var nextReason, var expectedChanges) = removeFirst ? (ChangeReason.Remove, ChangeReason.Add, InitialCount * 2) : (ChangeReason.Add, ChangeReason.Remove, InitialCount * 3); diff --git a/src/DynamicData.Tests/Domain/Market.cs b/src/DynamicData.Tests/Domain/Market.cs index 698216d87..4489f841e 100644 --- a/src/DynamicData.Tests/Domain/Market.cs +++ b/src/DynamicData.Tests/Domain/Market.cs @@ -78,7 +78,7 @@ public Market RefreshAllPrices(Func getNewPrice) => this.With(_ => }))); public Market RefreshAllPrices(Func getNewPrice) => RefreshAllPrices(_ => getNewPrice()); - + public Market RefreshAllPrices(decimal newPrice) => RefreshAllPrices(_ => newPrice); public void RemoveAllPrices() => this.With(_ => _latestPrices.Clear()); diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 0d59202a5..611fccc86 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -52,7 +52,7 @@ public void ExceptionTests() exSubject.OnNext(new MissingKeyException()); - Assert.IsType(exceptionRecived); + Assert.IsType(exceptionRecived); } } } diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index 5468f5eaa..c26080a23 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -72,7 +72,7 @@ public void WillApplyTimeout() { _pausingSubject.OnNext(true); - //should timeout + //should timeout _scheduler.AdvanceBy(TimeSpan.FromSeconds(61).Ticks); _source.Add(new Person("A", 1)); diff --git a/src/DynamicData.Tests/List/ChangeSetFixture.cs b/src/DynamicData.Tests/List/ChangeSetFixture.cs index 25aa530ee..4349b9900 100644 --- a/src/DynamicData.Tests/List/ChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ChangeSetFixture.cs @@ -132,11 +132,11 @@ public record struct CountsAreCorrectTestCase public required string Name { get; set; } public int ChangeCount { get; set; } - + public int AddCount { get; set; } public int AddRangeCount { get; set; } - + public int AddRangeSize { get; set; } public int MoveCount { get; set; } @@ -144,9 +144,9 @@ public record struct CountsAreCorrectTestCase public int RefreshCount { get; set; } public int RemoveCount { get; set; } - + public int RemoveRangeCount { get; set; } - + public int RemoveRangeSize { get; set; } public int ReplaceCount { get; set; } @@ -221,7 +221,7 @@ void IXunitSerializable.Deserialize(IXunitSerializationInfo info) ReplaceCount = info.GetValue(nameof(ReplaceCount)); TotalItemCount = info.GetValue(nameof(TotalItemCount)); } - + void IXunitSerializable.Serialize(IXunitSerializationInfo info) { info.AddValue(nameof(Name), Name); @@ -237,7 +237,7 @@ void IXunitSerializable.Serialize(IXunitSerializationInfo info) info.AddValue(nameof(ReplaceCount), ReplaceCount); info.AddValue(nameof(TotalItemCount), TotalItemCount); } - + public override string ToString() => Name; } diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index 1388c61d5..43a335e42 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -118,7 +118,7 @@ public void RemainingItemsAreDisposedAfterCompleted() public void RemainingItemsAreDisposedAfterError() { _itemsSource.Add(new(1)); - + var error = new Exception("Test Exception"); _changeSetsSource.OnError(error); diff --git a/src/DynamicData.Tests/List/FilterFixture.Base.cs b/src/DynamicData.Tests/List/FilterFixture.Base.cs index 30f8d498f..176e13413 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -104,7 +104,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC { // Setup using var source = new TestSourceList(); - + source.AddRange(new[] { new Item() { Id = 1, IsIncluded = true }, @@ -131,7 +131,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, + // UUT Action: Moves for matching items, source.Edit(items => { items.Move(2, 0); diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index 7b4ca83b2..4db0a25c5 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -61,7 +61,7 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ExcludedItemIsAdded_NoChangesAreMade() { @@ -87,7 +87,7 @@ public void ExcludedItemIsAdded_NoChangesAreMade() results.RecordedChangeSets.Skip(1).Should().BeEmpty("empty changesets should be suppressed"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void ExcludedItemIsRemoved_NoChangesAreMade() { @@ -206,7 +206,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate() { // Setup using var source = new TestSourceList(); - + source.AddRange(new[] { new Item() { Id = 1, IsIncluded = true }, @@ -231,7 +231,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, + // UUT Action: Moves for matching items, source.Edit(items => { items.Move(2, 0); @@ -403,7 +403,7 @@ public void MatchingItemIsAdded_ItemPropagates() results.RecordedItems.Should().BeEquivalentTo(source.Items, "the matching item should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] public void MatchingItemIsRemoved_RemovalPropagates() { diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index e3124caff..2351d9dc8 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -271,10 +271,10 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat // Test Remove, with an excluded item source.RemoveAt(3); - + // Test Remove, with both included and excluded items source.RemoveRange(index: 2, count: 2); - + // Test Replace, not affecting filtering var item9 = new Item() { Id = 9, IsIncluded = false }; var item10 = new Item() { Id = 10, IsIncluded = true }; @@ -520,7 +520,7 @@ public async Task SourceAndPredicateStateNotifyFromDifferentThreads_FilteringIsT maxChangeCount: 20, maxRangeSize: 10, randomizer: randomizer); - + var predicateStates = GenerateRandomPredicateStates( valueCount: 5_000, randomizer: randomizer); @@ -972,7 +972,7 @@ public static bool FilterByIdInclusionMask( int idInclusionMask, Item item) => ((item.Id & idInclusionMask) == 0) && item.IsIncluded; - + public required int Id { get; init; } public bool IsIncluded { get; set; } diff --git a/src/DynamicData.Tests/List/OnItemAddedFixture.cs b/src/DynamicData.Tests/List/OnItemAddedFixture.cs index ad057b97f..1936f6939 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -19,13 +19,13 @@ public void ItemIsAdded_AddActionIsInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (initialItemCount is 0) @@ -37,7 +37,7 @@ public void ItemIsAdded_AddActionIsInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + if (initialItemCount is 0) addActionInvocations.Should().BeEmpty("no initial items were added to the collection"); else @@ -46,12 +46,12 @@ public void ItemIsAdded_AddActionIsInvoked( config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.Insert( index: insertionIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was added to the collection"); @@ -80,13 +80,13 @@ public void ItemIsMoved_AddActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -95,18 +95,18 @@ public void ItemIsMoved_AddActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.Move( original: originalIndex, destination: destinationIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was moved within the collection"); @@ -132,13 +132,13 @@ public void ItemIsRefreshed_AddActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -147,16 +147,16 @@ public void ItemIsRefreshed_AddActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.Refresh(refreshIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was refreshed within the collection"); @@ -183,13 +183,13 @@ public void ItemIsRemoved_AddActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -198,16 +198,16 @@ public void ItemIsRemoved_AddActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.RemoveAt(removalIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was removed from the collection"); @@ -233,13 +233,13 @@ public void ItemIsReplaced_AddActionIsInvokedForNewItem( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -248,18 +248,18 @@ public void ItemIsReplaced_AddActionIsInvokedForNewItem( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.ReplaceAt( index: replacementIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was replaced within the collection"); @@ -287,13 +287,13 @@ public void ItemRangeIsRemoved_AddActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -302,18 +302,18 @@ public void ItemRangeIsRemoved_AddActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.RemoveRange( index: removalIndex, count: removalCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle($"{removalCount} item{((removalCount is 1) ? "" : "s")} should have been removed"); @@ -321,7 +321,7 @@ public void ItemRangeIsRemoved_AddActionIsNotInvoked( expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + addActionInvocations.Should().BeEmpty("no items were added to the collection"); } @@ -335,13 +335,13 @@ public void ItemsAreCleared_AddActionIsNotInvoked(int initialItemCount) source.AddRange(Enumerable.Range(1, initialItemCount)); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -350,16 +350,16 @@ public void ItemsAreCleared_AddActionIsNotInvoked(int initialItemCount) config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.Clear(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("all items in the collection should have been removed"); @@ -367,7 +367,7 @@ public void ItemsAreCleared_AddActionIsNotInvoked(int initialItemCount) expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + addActionInvocations.Should().BeEmpty("no items were added to the collection"); } @@ -384,13 +384,13 @@ public void SourceCompletesAsynchronously_CompletionPropagates() }); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -399,20 +399,20 @@ public void SourceCompletesAsynchronously_CompletionPropagates() config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action source.Complete(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + addActionInvocations.Should().BeEmpty("no items were added to the collection"); } @@ -428,15 +428,15 @@ public void SourceCompletesImmediately_CompletionPropagates() 3 }); source.Complete(); - + var addActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -444,7 +444,7 @@ public void SourceCompletesImmediately_CompletionPropagates() expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), @@ -465,13 +465,13 @@ public void SourceFailsAsynchronously_CompletionPropagates() }); var addActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemAdded(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -480,20 +480,20 @@ public void SourceFailsAsynchronously_CompletionPropagates() config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + addActionInvocations.Should().BeEquivalentTo( expectation: source.Items, config: options => options.WithoutStrictOrdering(), because: "the collection contained initial items"); addActionInvocations.Clear(); - + // UUT Action var error = new Exception(); source.SetError(error); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + addActionInvocations.Should().BeEmpty("no items were added to the collection"); } @@ -510,18 +510,18 @@ public void SourceFailsImmediately_CompletionPropagates() }); var error = new Exception(); source.SetError(error); - + var addActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemRemoved(addActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("an error occurred during subscription"); - + addActionInvocations.Should().BeEmpty("an error occurred during subscription"); } } diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index 4f919d248..bc3ea8098 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -19,13 +19,13 @@ public void ItemIsAdded_RefreshActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (initialItemCount is 0) @@ -37,14 +37,14 @@ public void ItemIsAdded_RefreshActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action source.Insert( index: insertionIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was refreshed within the collection"); @@ -73,13 +73,13 @@ public void ItemIsMoved_RefreshActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -88,14 +88,14 @@ public void ItemIsMoved_RefreshActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action source.Move( original: originalIndex, destination: destinationIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was moved within the collection"); @@ -121,13 +121,13 @@ public void ItemIsRefreshed_RefreshActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -136,13 +136,13 @@ public void ItemIsRefreshed_RefreshActionIsNotInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action var refreshedItem = source.Items[refreshIndex]; source.Refresh(refreshIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was refreshed within the collection"); @@ -169,13 +169,13 @@ public void ItemIsRemoved_RefreshActionIsInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -184,13 +184,13 @@ public void ItemIsRemoved_RefreshActionIsInvoked( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was removed from the collection"); @@ -216,13 +216,13 @@ public void ItemIsReplaced_RefreshActionIsInvokedForOldItem( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -231,14 +231,14 @@ public void ItemIsReplaced_RefreshActionIsInvokedForOldItem( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action source.ReplaceAt( index: replacementIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was replaced within the collection"); @@ -266,13 +266,13 @@ public void ItemRangeIsRemoved_RefreshActionIsInvokedForEachItem( source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -281,14 +281,14 @@ public void ItemRangeIsRemoved_RefreshActionIsInvokedForEachItem( config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action source.RemoveRange( index: removalIndex, count: removalCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle($"{removalCount} item{((removalCount is 1) ? "" : "s")} should have been removed"); @@ -296,7 +296,7 @@ public void ItemRangeIsRemoved_RefreshActionIsInvokedForEachItem( expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } @@ -310,13 +310,13 @@ public void ItemsAreCleared_RefreshActionIsInvokedForEachItem(int initialItemCou source.AddRange(Enumerable.Range(1, initialItemCount)); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -325,12 +325,12 @@ public void ItemsAreCleared_RefreshActionIsInvokedForEachItem(int initialItemCou config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - + // UUT Action source.Clear(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("all items in the collection should have been removed"); @@ -338,7 +338,7 @@ public void ItemsAreCleared_RefreshActionIsInvokedForEachItem(int initialItemCou expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } @@ -355,13 +355,13 @@ public void SourceCompletesAsynchronously_CompletionPropagates() }); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -370,16 +370,16 @@ public void SourceCompletesAsynchronously_CompletionPropagates() config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action source.Complete(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } @@ -395,15 +395,15 @@ public void SourceCompletesImmediately_CompletionPropagates() 3 }); source.Complete(); - + var refreshActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -411,7 +411,7 @@ public void SourceCompletesImmediately_CompletionPropagates() expectation: source.Items, config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } @@ -428,13 +428,13 @@ public void SourceFailsAsynchronously_CompletionPropagates() }); var refreshActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); @@ -443,16 +443,16 @@ public void SourceFailsAsynchronously_CompletionPropagates() config: options => options.WithStrictOrdering(), because: "all collection changes should propagate downstream"); results.ClearChangeSets(); - + refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var error = new Exception(); source.SetError(error); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } @@ -469,18 +469,18 @@ public void SourceFailsImmediately_CompletionPropagates() }); var error = new Exception(); source.SetError(error); - + var refreshActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemRefreshed(refreshActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("an error occurred during subscription"); - + refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); } } diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index 1f777c389..f0a4a56ee 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -15,7 +15,7 @@ public void SubscriberDoesNotHandleErrors_ErrorBubblesUpstream(bool invokeOnUnsu removeAction: static _ => { }, invokeOnUnsubscribe: invokeOnUnsubscribe) .Subscribe(); - + var error = new Exception("Test"); FluentActions.Invoking(() => source.SetError(error)) @@ -44,7 +44,7 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction var subscription = source.Connect() .OnItemRemoved( @@ -52,7 +52,7 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining invokeOnUnsubscribe: true) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (initialItemCount is 0) @@ -61,9 +61,9 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -74,7 +74,7 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining source.RemoveRange( index: removalIndex, count: removalCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (removalCount is 0) @@ -82,13 +82,13 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining else results.RecordedChangeSets.Should().ContainSingle($"{removalCount} item{((removalCount is 1) ? "" : "s")} should have been removed"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); - + removeActionInvocations.Should().BeEquivalentTo(removedItems, options => options.WithoutStrictOrdering(), "the removal action should be invoked for every removed item"); removeActionInvocations.Clear(); - + // UUT Action subscription.Dispose(); - + removeActionInvocations.Should().BeEquivalentTo(source.Items, options => options.WithoutStrictOrdering(), "the removal action should be invoked for all all remaining items"); } @@ -111,7 +111,7 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction var subscription = source.Connect() .OnItemRemoved( @@ -119,7 +119,7 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti invokeOnUnsubscribe: false) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (initialItemCount is 0) @@ -128,9 +128,9 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -141,7 +141,7 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti source.RemoveRange( index: removalIndex, count: removalCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (removalCount is 0) @@ -149,13 +149,13 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti else results.RecordedChangeSets.Should().ContainSingle($"{removalCount} item{((removalCount is 1) ? "" : "s")} should have been removed"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); - + removeActionInvocations.Should().BeEquivalentTo(removedItems, options => options.WithoutStrictOrdering(), "the removal action should be invoked for every removed item"); removeActionInvocations.Clear(); - + // UUT Action subscription.Dispose(); - + removeActionInvocations.Should().BeEmpty("the removal action should not be invoked upon unsubscription"); } @@ -176,13 +176,13 @@ public void ItemIsAdded_RemoveActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); if (initialItemCount is 0) @@ -191,14 +191,14 @@ public void ItemIsAdded_RemoveActionIsNotInvoked( results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action source.Insert( index: insertionIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was refreshed within the collection"); @@ -224,26 +224,26 @@ public void ItemIsMoved_RemoveActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action source.Move( original: originalIndex, destination: destinationIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was moved within the collection"); @@ -267,25 +267,25 @@ public void ItemIsRemoved_RemoveActionIsInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was removed from the collection"); @@ -309,24 +309,24 @@ public void ItemIsRefreshed_RemoveActionIsNotInvoked( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action source.Refresh(refreshIndex); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was refreshed within the collection"); @@ -349,27 +349,27 @@ public void ItemIsReplaced_RemoveActionIsInvokedForOldItem( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var replacedItem = source.Items[replacementIndex]; source.ReplaceAt( index: replacementIndex, item: initialItemCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("an item was replaced within the collection"); @@ -395,7 +395,7 @@ public void ItemRangeIsRemoved_RemoveActionIsInvokedForEachItem( source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved( @@ -403,15 +403,15 @@ public void ItemRangeIsRemoved_RemoveActionIsInvokedForEachItem( invokeOnUnsubscribe: true) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var removedItems = source.Items .Skip(removalIndex) @@ -421,12 +421,12 @@ public void ItemRangeIsRemoved_RemoveActionIsInvokedForEachItem( source.RemoveRange( index: removalIndex, count: removalCount); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle($"{removalCount} item{((removalCount is 1) ? "" : "s")} should have been removed"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); - + removeActionInvocations.Should().BeEquivalentTo(removedItems, options => options.WithoutStrictOrdering(), "the removal action should be invoked for every removed item"); } @@ -440,32 +440,32 @@ public void ItemsAreCleared_RemoveActionIsInvokedForEachItem(int initialItemCoun source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved(removeActionInvocations.Add) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var clearedItems = source.Items .ToArray(); source.Clear(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("all items in the collection should have been removed"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); - + removeActionInvocations.Should().BeEquivalentTo(clearedItems, options => options.WithoutStrictOrdering(), "the removal action should be invoked for every removed item"); } @@ -484,7 +484,7 @@ public void SourceCompletesAsynchronously_CompletionPropagates(bool invokeOnUnsu }); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved( @@ -492,22 +492,22 @@ public void SourceCompletesAsynchronously_CompletionPropagates(bool invokeOnUnsu invokeOnUnsubscribe: invokeOnUnsubscribe) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action source.Complete(); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + if (invokeOnUnsubscribe) removeActionInvocations.Should().BeEquivalentTo(source.Items, options => options.WithoutStrictOrdering(), "the operator was instructed to invoke the removal action all remaining items, upon stream completion"); else @@ -528,9 +528,9 @@ public void SourceCompletesImmediately_CompletionPropagates(bool invokeOnUnsubsc 3 }); source.Complete(); - + var removeActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemRemoved( @@ -538,12 +538,12 @@ public void SourceCompletesImmediately_CompletionPropagates(bool invokeOnUnsubsc invokeOnUnsubscribe: invokeOnUnsubscribe) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeTrue("the source has completed"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); - + if (invokeOnUnsubscribe) removeActionInvocations.Should().BeEquivalentTo(source.Items, options => options.WithoutStrictOrdering(), "the operator was instructed to invoke the removal action all remaining items, upon stream completion"); else @@ -565,7 +565,7 @@ public void SourceFailsAsynchronously_CompletionPropagates(bool invokeOnUnsubscr }); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved( @@ -573,22 +573,22 @@ public void SourceFailsAsynchronously_CompletionPropagates(bool invokeOnUnsubscr invokeOnUnsubscribe: invokeOnUnsubscribe) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeNull("no errors should have occurred"); results.HasCompleted.Should().BeFalse("the source can still publish notifications"); results.RecordedChangeSets.Should().ContainSingle("the initial items should have been published"); results.RecordedItems.Should().BeEquivalentTo(source.Items, options => options.WithStrictOrdering(), "all collection changes should propagate downstream"); results.ClearChangeSets(); - + removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - + // UUT Action var error = new Exception(); source.SetError(error); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("no changes were made to the collection"); - + if (invokeOnUnsubscribe) removeActionInvocations.Should().BeEquivalentTo(source.Items, options => options.WithoutStrictOrdering(), "the operator was instructed to invoke the removal action all remaining items, upon stream failure"); else @@ -610,9 +610,9 @@ public void SourceFailsImmediately_CompletionPropagates(bool invokeOnUnsubscribe }); var error = new Exception(); source.SetError(error); - + var removeActionInvocations = new List(); - + // UUT Construction & Action using var subscription = source.Connect() .OnItemRemoved( @@ -620,10 +620,10 @@ public void SourceFailsImmediately_CompletionPropagates(bool invokeOnUnsubscribe invokeOnUnsubscribe: invokeOnUnsubscribe) .ValidateChangeSets() .RecordListItems(out var results); - + results.Error.Should().BeSameAs(error, "errors within the stream should propagate"); results.RecordedChangeSets.Should().BeEmpty("an error occurred during subscription"); - + removeActionInvocations.Should().BeEmpty(invokeOnUnsubscribe ? "the initial items in the collection were never published" : "the operator was instructed to not invoke the removal action, upon stream failure"); diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index 09b62d074..6f29f7932 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -32,7 +32,7 @@ private class ListItem(int number) : IComparable public int Number { get; } = number; public int CompareTo(ListItem? other) => DefaultComparer.Compare(this, other); - + } } diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 86b3ca340..6ec0c5297 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -38,7 +38,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( .ValidateSynchronization() .ValidateChangeSets() .RecordListItems(out var results1); - + using var subscription2 = Observable.Interval( period: TimeSpan.FromMilliseconds(5), scheduler: scheduler) diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index 41eb3d37d..00d91579d 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -83,7 +83,7 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(5).Count().Should().Be(1, "1 item was emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -94,7 +94,7 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(6).Count().Should().Be(1, "1 item was emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, because: "1 item was emitted, and 1 was evicted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -114,7 +114,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -137,7 +137,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedChangeSets.Count.Should().Be(2, "1 item was emitted, after initialization"); else results.RecordedChangeSets.Count.Should().Be(1, "an initial changeset should always be emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("1 item has yet to expire"); @@ -168,7 +168,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -191,7 +191,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour results.RecordedChangeSets.Count.Should().Be(2, "1 item was emitted, after initialization"); else results.RecordedChangeSets.Count.Should().Be(1, "an initial changeset should always be emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeTrue("the source has completed, and no items remain to be expired"); @@ -226,7 +226,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 item was emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1 }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -238,7 +238,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(2).Count().Should().Be(1, "1 item was emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -250,7 +250,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "1 item was emitted"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2, item3 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2, item3 }, because: "1 item was emitted", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -260,7 +260,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(4).Count().Should().Be(1, "1 expiration should have occurred"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, because: "1 item expired, and 1 had its lifetime extended", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -270,7 +270,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(5).Should().BeEmpty("no expirations should have occurred"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item1, item2 }, because: "no changes were made", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -280,7 +280,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(5).Count().Should().Be(1, "1 expiration should have occurred"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item2 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item2 }, because: "1 item reached its expiration", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -290,7 +290,7 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(6).Should().BeEmpty("no expirations should have occurred"); - results.RecordedItems.Should().BeEquivalentTo(new[] { item2 }, + results.RecordedItems.Should().BeEquivalentTo(new[] { item2 }, because: "no changes were made", config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); @@ -305,7 +305,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var error = new Exception("Test Exception"); var source = sourceType switch - { + { SourceType.Asynchronous => new Subject(), SourceType.Immediate => Observable.Throw(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 9b6ca5766..59897b124 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -41,7 +41,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( .ValidateSynchronization() .ValidateChangeSets() .RecordListItems(out var results1); - + using var subscription2 = Observable.Interval( period: TimeSpan.FromMilliseconds(5), scheduler: scheduler) diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index b7fec6533..7389c67e0 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -122,7 +122,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -183,7 +183,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - + var scheduler = new TestScheduler(); // UUT Initialization & Action @@ -298,7 +298,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var error = new Exception("Test Exception"); var source = sourceType switch - { + { SourceType.Asynchronous => new Subject>(), SourceType.Immediate => Observable.Throw>(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) diff --git a/src/DynamicData.Tests/List/TransformManyFixture.cs b/src/DynamicData.Tests/List/TransformManyFixture.cs index eda7cff58..74765f85e 100644 --- a/src/DynamicData.Tests/List/TransformManyFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyFixture.cs @@ -83,7 +83,7 @@ public void Dispose() [Fact] public void Move() { - //Move should have no effect + //Move should have no effect var child4 = new PersonWithRelations("Child4", 1); var child5 = new PersonWithRelations("Child5", 2); diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs index 96870d64c..6c3657e38 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs @@ -15,7 +15,7 @@ public CacheItemRecordingObserver(IScheduler scheduler) _recordedChangeSets = new(); _recordedItemsByKey = new(); _recordedItemsSorted = new(); - } + } public IReadOnlyList> RecordedChangeSets => _recordedChangeSets; diff --git a/src/DynamicData.Tests/Utilities/FakeScheduler.cs b/src/DynamicData.Tests/Utilities/FakeScheduler.cs index 2ffd3cd62..0be6c1698 100644 --- a/src/DynamicData.Tests/Utilities/FakeScheduler.cs +++ b/src/DynamicData.Tests/Utilities/FakeScheduler.cs @@ -26,7 +26,7 @@ public IDisposable Schedule( state: state, dueTime: null, action: action); - + public IDisposable Schedule( TState state, TimeSpan dueTime, @@ -35,7 +35,7 @@ public IDisposable Schedule( state: state, dueTime: _now + dueTime, action: action); - + public IDisposable Schedule( TState state, DateTimeOffset dueTime, diff --git a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs index c9ad14179..750004469 100644 --- a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs @@ -12,7 +12,7 @@ public ListItemRecordingObserver(IScheduler scheduler) { _recordedChangeSets = new(); _recordedItems = new(); - } + } public IReadOnlyList> RecordedChangeSets => _recordedChangeSets; @@ -22,7 +22,7 @@ public IReadOnlyList RecordedItems public void ClearChangeSets() => _recordedChangeSets.Clear(); - + protected override void OnNext(IChangeSet value) { if (!HasFinalized) diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index ffe4958a7..206667e9c 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -16,7 +16,7 @@ e is not null : source; /// - /// Creates an observable that parallelizes some given work by taking the source observable, creates multiple subscriptions, limiting each to a certain number of values, and + /// Creates an observable that parallelizes some given work by taking the source observable, creates multiple subscriptions, limiting each to a certain number of values, and /// attaching some work to be done in parallel to each before merging them back together. /// /// Input Observable type. @@ -30,7 +30,7 @@ public static IObservable Parallelize(this IObservable source, int c Observable.Merge(Distribute(count, parallel).Select(n => fnAttachParallelWork(source.Take(n)))); /// - /// Creates an observable that parallelizes some given work by taking the source observable, creates multiple subscriptions, limiting each to a certain number of values, and + /// Creates an observable that parallelizes some given work by taking the source observable, creates multiple subscriptions, limiting each to a certain number of values, and /// merging them back together. /// /// Observable type. @@ -243,7 +243,7 @@ public static IObservable> ValidateChangeSets(); var sortedKeys = new List(); var isSorted = null as bool?; - + var reasons = Enum.GetValues(); return source.SubscribeSafe(RawAnonymousObserver.Create>( @@ -299,7 +299,7 @@ public static IObservable> ValidateChangeSets TestLogger(ITestOutputHelper testOutputHelper) => #endif #if DEBUG - private static void DebugLogger(string str) => System.Diagnostics.Debug.WriteLine(str); + private static void DebugLogger(string str) => System.Diagnostics.Debug.WriteLine(str); #elif DEBUG_SPY_ALWAYS - private static void DebugLogger(string str) => NativeMethods.OutputDebugString(str); + private static void DebugLogger(string str) => NativeMethods.OutputDebugString(str); #endif } diff --git a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs index b5ad8a843..35351693e 100644 --- a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs +++ b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs @@ -32,10 +32,10 @@ public RawAnonymousObserver( public void OnCompleted() => _onCompleted.Invoke(); - + public void OnError(Exception error) => _onError.Invoke(error); - + public void OnNext(T value) => _onNext.Invoke(value); } diff --git a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs index e725b8340..8323773e7 100644 --- a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs +++ b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs @@ -44,7 +44,7 @@ void IObserver.OnCompleted() _hasCompleted = true; _whenFinalizedSource.SetResult(); } - + void IObserver.OnError(Exception error) { _notifications.Add(new( diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index 01b78fe49..927708eac 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -27,7 +27,7 @@ public IObservable CountChanged public IReadOnlyList Items => _source.Items; - + public IReadOnlyList Keys => _source.Keys; @@ -89,7 +89,7 @@ private void AssertCanMutate() } private IObservable WrapStream(IObservable sourceStream) - => Observable.Create(downstreamObserver => + => Observable.Create(downstreamObserver => { var whenCompleted = _hasCompleted .Where(static hasCompleted => hasCompleted) diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index 70a885a20..5ad04fb53 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -51,14 +51,14 @@ public void Dispose() _refreshRequested.Dispose(); _refreshRequestedPreview.Dispose(); } - + public void Edit(Action> updateAction) { AssertCanMutate(); _source.Edit(updateAction); } - + public IObservable> Preview(Func? predicate = null) => WrapStream(Observable.Merge( _source.Preview(predicate), @@ -126,7 +126,7 @@ private IObservable WrapStream(IObservable sourceStream) { var hasCompleted = _hasCompleted .Publish(); - + var subscription = Observable .Merge( _error @@ -138,10 +138,10 @@ private IObservable WrapStream(IObservable sourceStream) .TakeUntil(hasCompleted .Where(static hasCompleted => hasCompleted)) .SubscribeSafe(downstreamObserver); - + // Make sure that an initial changeset gets published, before immediate completion. var connection = hasCompleted.Connect(); - + return Disposable.Create(() => { connection.Dispose();