diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 95d5c3c41..7ba2cd095 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -89,6 +89,21 @@ 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 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. + +Four opt-in namespaces are the exception and **must** stay file-level: + +| Namespace | Why | +|---|---| +| `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 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 Most operators follow the same two-part pattern: 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/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..262a72f10 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] @@ -79,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/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..039a1ec0b 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()); @@ -150,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 484e544e1..2a7efa484 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,8 +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 @@ -55,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() ); @@ -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..4defdcacc 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -1,13 +1,20 @@ - + Exe net9.0 - AnyCPU - false - ;1591;1701;1702;1705;CA1822;CA1001 + $(NoWarn);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..2429df785 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] @@ -101,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 6e4ab39ee..5a33e9bf1 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] @@ -111,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() { @@ -120,7 +110,7 @@ private static ImmutableArray> GenerateChangeSets( }) .ToArray()); changeSets.Add(items.CaptureChanges()); - + while (changeSets.Count < changeSets.Capacity) { var changeCount = randomizer.Int(1, maxChangeCount); @@ -204,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 e9065ef17..7aa494d11 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] @@ -113,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); @@ -201,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 3707767be..ba5040c94 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] @@ -22,7 +13,7 @@ public Filter_List_WithPredicateState() maxChangeCount: 20, maxRangeSize: 10, randomizer: randomizer); - + _predicateStates = GenerateRandomPredicateStates( valueCount: 5_000, randomizer: randomizer); @@ -226,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.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..b13c84646 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 { @@ -19,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) @@ -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..93fe86384 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 { @@ -262,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/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..eeaf7ac8e 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 { @@ -103,7 +89,7 @@ public void SubscribeToValueChangeForAllItemsInList(bool notifyOnInitialValue) anotherPerson.Age = 13; lastAgeChange.Should().Be(13); } - + [Fact] public void CastToNullable() { @@ -112,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"); @@ -143,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, @@ -170,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/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..684aec434 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); @@ -108,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) @@ -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 718df9537..e24ad0e5d 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 System.Linq; -using DynamicData.Binding; -using DynamicData.Tests.Utilities; -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Binding; /// @@ -162,7 +152,7 @@ public void ExpressionContainsImplicitInterfaceCast() { Age = 10 }; - + using var subscription = ObserveAge(child) .RecordValues(out var results); @@ -180,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/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..c99075218 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 { @@ -33,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); @@ -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); @@ -93,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); @@ -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(); @@ -150,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); @@ -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..dd2a043a5 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 { @@ -31,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); @@ -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( @@ -133,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); @@ -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(); @@ -196,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); @@ -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,11 +256,10 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s ? Observable.Return(changeSet) : new Subject>(); - 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); @@ -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,11 +310,10 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp .Concat(Observable.Throw>(error)) : new Subject>(); - 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); @@ -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..f37feae49 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 { @@ -129,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 ebdc26950..569c53b40 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 { @@ -26,12 +13,11 @@ 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(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -46,26 +32,23 @@ 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; - + 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"); @@ -73,35 +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"); @@ -110,10 +89,9 @@ 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); - + // Normal refreshes should not be buffered results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed"); @@ -123,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() { @@ -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 }; @@ -157,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() { @@ -167,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), @@ -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() { @@ -200,7 +176,7 @@ public void ItemIsMoved_NotificationPropagates() key: item3.Id, current: item3, currentIndex: 0, - previousIndex: 2) + previousIndex: 2) }); results.Error.Should().BeNull(); @@ -213,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() { @@ -223,9 +199,8 @@ 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()) @@ -259,9 +234,8 @@ 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()) @@ -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); @@ -282,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"); @@ -297,9 +270,8 @@ 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()) @@ -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); @@ -321,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() { @@ -337,9 +308,8 @@ 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()) @@ -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; @@ -374,12 +343,11 @@ 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(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -394,15 +362,13 @@ 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; - + 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"); - // UUT Action (publish additional property change notification, immediately) ++item2.Value; @@ -410,10 +376,9 @@ 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); - + 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"); @@ -421,37 +386,33 @@ 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"); - // UUT Action (publish additional property change notification, within throttle window) 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"); @@ -460,16 +421,15 @@ 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 if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -492,15 +452,14 @@ 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) @@ -525,17 +484,16 @@ 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) @@ -574,14 +532,13 @@ 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)) @@ -594,14 +551,13 @@ 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(); 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 c948aedb8..dff506c4d 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 { @@ -23,7 +12,7 @@ public void PropertyAccessorIsNull_ThrowsException() propertyAccessor: (null as Expression>)!)) .Should() .Throw(); - + [Fact] public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotification() { @@ -33,9 +22,8 @@ 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()) @@ -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; @@ -56,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 402d175ff..69b6e319f 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 { @@ -23,9 +14,8 @@ 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()) @@ -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(); @@ -50,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 be5b936a3..3937c4940 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 { @@ -15,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; @@ -32,13 +30,13 @@ public int OtherValue { if (_otherValue == value) return; - + _otherValue = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OtherValue))); } } - + public int Value { get => _value; @@ -46,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 a09e0ea9c..18ffeeb7b 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 { @@ -27,12 +13,11 @@ 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(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -48,26 +33,23 @@ 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; - + 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"); @@ -75,35 +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"); @@ -112,10 +90,9 @@ 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); - + // Normal refreshes should not be buffered results.Error.Should().BeNull(); results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed"); @@ -125,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() { @@ -135,7 +112,6 @@ 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( @@ -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 }); @@ -162,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() { @@ -172,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), @@ -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() { @@ -207,7 +181,7 @@ public void ItemIsMoved_NotificationPropagates() key: item3.Id, current: item3, currentIndex: 0, - previousIndex: 2) + previousIndex: 2) }); results.Error.Should().BeNull(); @@ -220,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() { @@ -230,11 +204,10 @@ 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( @@ -278,9 +251,8 @@ 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( @@ -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); @@ -303,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"); @@ -318,9 +289,8 @@ 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( @@ -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); @@ -344,16 +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"); @@ -362,21 +330,20 @@ 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) @@ -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(); @@ -405,8 +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(); @@ -414,19 +379,18 @@ 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) @@ -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(); @@ -455,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() { @@ -465,9 +428,8 @@ 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( @@ -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; @@ -494,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() { @@ -504,9 +465,8 @@ 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( @@ -522,23 +482,22 @@ 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) @@ -563,16 +522,15 @@ 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"); - // 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); @@ -593,16 +550,15 @@ 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 if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -627,15 +583,14 @@ 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) @@ -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(); @@ -679,17 +632,16 @@ 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) @@ -732,14 +684,13 @@ 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( @@ -754,14 +705,13 @@ 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(); 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 4fa7ec9d7..421c57850 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 { @@ -20,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 3e96d6e96..36b7ba7df 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 { @@ -20,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 4e6f974a2..045e69acc 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 { @@ -23,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; @@ -49,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/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..07202ada4 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 { @@ -217,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/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..6bfc7a2c2 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 { @@ -141,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/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..b250f2232 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"); @@ -678,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 868fad2fd..90409b307 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"); @@ -961,7 +942,7 @@ private static void PublishStressChangeSets( foreach(var changeSet in changeSets) source.OnNext(changeSet); } - + private static async Task WaitForCompletionAsync( CacheItemRecordingObserver results, TimeSpan timeout) @@ -976,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/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 24e645f15..40fffd7b7 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..16ab0a822 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 { @@ -29,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) @@ -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 c8edb7e18..eea5f05a6 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(StreamCompletionStrategy compl ? 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 StreamCompletionStrategy.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..29d323d3e 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 { @@ -30,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) @@ -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 e1a1fb5eb..9a0485baf 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(StreamCompletionStrategy compl ? 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(StreamCompletionStrategy completi ? 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 StreamCompletionStrategy.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 StreamCompletionStrategy.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..7246cd240 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 { @@ -28,7 +17,7 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() editCount: 5_000, maxChangeCount: 20, randomizer: randomizer); - + var predicateStates = GenerateRandomIdInclusionMasks( valueCount: 5_000, randomizer: randomizer) @@ -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 6fa22b720..baff6a4a2 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(StreamCompletionStrategy complet ? 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 StreamCompletionStrategy.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 StreamCompletionStrategy.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 a596f3460..cc33d2aab 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.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { @@ -33,7 +21,6 @@ public void SourceCompletes_CompletionPropagates(StreamCompletionStrategy comple // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is StreamCompletionStrategy.Immediate) source.Complete(); @@ -51,7 +38,6 @@ public void SourceCompletes_CompletionPropagates(StreamCompletionStrategy comple 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 8ff9a3a29..8c0334eca 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 { @@ -36,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/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..ade5a5847 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 { @@ -66,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/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..308fdc0d5 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")); @@ -297,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 bdad60ee9..8f3aad4d7 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 { @@ -32,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/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..9c2538612 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)] @@ -829,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/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..b855721d7 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) => { @@ -42,18 +27,16 @@ 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); } }, 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..62a5f9772 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")); @@ -315,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/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..2ab7c306a 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 { @@ -166,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); @@ -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,14 +189,13 @@ 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 _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); } @@ -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() { @@ -326,14 +298,13 @@ public void InsertAtEnd() _source.AddOrUpdate(toInsert); _boundList.Count.Should().Be(101); - + var last = _boundList[^1]; last.Should().Be(toInsert); _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,21 +523,18 @@ 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() { var people = _generator.Take(100).ToArray(); _source.AddOrUpdate(people); - + _boundList.Count.Should().Be(100); people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -594,13 +549,11 @@ 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); + 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..3cf998738 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() { @@ -89,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(); @@ -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..ffec59692 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 { @@ -37,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); @@ -50,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); @@ -60,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); @@ -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..a4fae8d97 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 { @@ -40,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(); @@ -61,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(); @@ -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..a58afab25 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,19 +149,16 @@ public void EmptyChangesWithFilter() change!.Count.Should().Be(0); } - - [Fact] 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(); 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 9b3dec0e5..9265dd045 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -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 d98bf2ad2..0409a60ae 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SwitchFixture { @@ -20,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); @@ -46,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); @@ -60,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); @@ -77,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/ToCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs index e4d18f9aa..fafdd19d4 100644 --- a/src/DynamicData.Tests/Cache/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ToCollectionFixture { @@ -20,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; } } @@ -32,14 +21,13 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() // Setup using var source = new SourceCache(TestItem.SelectId); - // UUT Initialization var priorResults = new List>(); 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"); @@ -48,7 +36,6 @@ 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[] @@ -57,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"); @@ -67,8 +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[] { @@ -76,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"); @@ -87,10 +73,9 @@ public void WhenChangesAreMade_ResultMatchesSourceAndPriorResultsAreNotMutated() priorResults.Add(results.RecordedValues[^1].ToArray()); - // 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"); @@ -110,7 +95,6 @@ public void WhenSourceCompletes_CompletionPropagates(StreamCompletionStrategy co // Setup using var source = new TestSourceCache(TestItem.SelectId); - // UUT Initialization & Action if (completionStrategy is StreamCompletionStrategy.Immediate) source.Complete(); @@ -136,7 +120,6 @@ public void WhenSourceFails_ErrorPropagates(StreamCompletionStrategy completionS // Setup using var source = new TestSourceCache(TestItem.SelectId); - // UUT Initialization & Action var error = new Exception("Test"); @@ -167,7 +150,7 @@ public void WhenSourceIsNull_ThrowsException() .Should().Throw() .WithParameterName("source") .Which; - + _output.WriteLine(result.ToString()); } @@ -177,7 +160,6 @@ public void WhenSubscriptionIsDisposed_SubscriptionDisposalPropagates() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .ToCollection() @@ -189,7 +171,6 @@ public void WhenSubscriptionIsDisposed_SubscriptionDisposalPropagates() //results.RecordedValues[^1].Should().BeEmpty("no 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/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 8dd0ae91e..c1bac313a 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 { @@ -50,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 892f55535..d116eae5f 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); @@ -188,9 +165,8 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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(); } @@ -246,9 +220,8 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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(); } @@ -514,13 +465,12 @@ 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)) }; - // 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..0c85963fd 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 { @@ -53,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 94213315a..64fd23287 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 }); @@ -200,9 +176,8 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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(); } @@ -263,9 +236,8 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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(); } @@ -471,13 +427,12 @@ 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)) }; - // 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..3788fc544 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 { @@ -223,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/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..27c16ad40 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 { @@ -179,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/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..4489f841e 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 { @@ -87,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()); @@ -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..d96a8af83 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -1,4 +1,4 @@ - + net9.0 $(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006 @@ -24,4 +24,37 @@ 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..611fccc86 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 { @@ -61,7 +52,7 @@ public void ExceptionTests() exSubject.OnNext(new MissingKeyException()); - Assert.IsType(exceptionRecived); + Assert.IsType(exceptionRecived); } } } 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..c26080a23 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 { @@ -83,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/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..4349b9900 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 { @@ -149,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; } @@ -161,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; } @@ -238,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); @@ -254,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/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..43a335e42 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 { @@ -128,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/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..176e13413 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[] { @@ -116,7 +104,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC { // Setup using var source = new TestSourceList(); - + source.AddRange(new[] { new Item() { Id = 1, IsIncluded = true }, @@ -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,8 +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); @@ -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..4db0a25c5 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); @@ -75,14 +61,13 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); } - + [Fact] 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 }); @@ -103,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() { @@ -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[] { @@ -228,7 +206,7 @@ public void ItemsAreMoved_MatchingMovementsPropagate() { // Setup using var source = new TestSourceList(); - + source.AddRange(new[] { new Item() { Id = 1, IsIncluded = true }, @@ -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,8 +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); @@ -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 }); @@ -436,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() { @@ -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..2351d9dc8 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); @@ -306,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 }; @@ -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); @@ -561,12 +520,11 @@ public async Task SourceAndPredicateStateNotifyFromDifferentThreads_FilteringIsT maxChangeCount: 20, maxRangeSize: 10, randomizer: randomizer); - + var predicateStates = GenerateRandomPredicateStates( 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() { @@ -1019,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/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..1936f6939 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 { @@ -28,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) @@ -46,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 @@ -55,13 +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"); @@ -90,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"); @@ -105,19 +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"); @@ -143,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"); @@ -158,17 +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"); @@ -195,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"); @@ -210,17 +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"); @@ -246,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"); @@ -261,19 +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"); @@ -301,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"); @@ -316,19 +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"); @@ -336,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"); } @@ -350,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"); @@ -365,17 +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"); @@ -383,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"); } @@ -400,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"); @@ -415,21 +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"); } @@ -445,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"); @@ -461,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(), @@ -482,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"); @@ -497,21 +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"); } @@ -528,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 c044d8e89..bc3ea8098 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 { @@ -28,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) @@ -46,15 +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"); @@ -83,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"); @@ -98,15 +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"); @@ -132,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"); @@ -147,14 +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"); @@ -181,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"); @@ -196,14 +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"); @@ -229,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"); @@ -244,15 +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"); @@ -280,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"); @@ -295,15 +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"); @@ -311,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"); } @@ -325,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"); @@ -340,13 +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"); @@ -354,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"); } @@ -371,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"); @@ -386,17 +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"); } @@ -412,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"); @@ -428,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"); } @@ -445,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"); @@ -460,17 +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"); } @@ -487,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 6b91fc11d..f0a4a56ee 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 { @@ -25,7 +15,7 @@ public void SubscriberDoesNotHandleErrors_ErrorBubblesUpstream(bool invokeOnUnsu removeAction: static _ => { }, invokeOnUnsubscribe: invokeOnUnsubscribe) .Subscribe(); - + var error = new Exception("Test"); FluentActions.Invoking(() => source.SetError(error)) @@ -54,7 +44,7 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction var subscription = source.Connect() .OnItemRemoved( @@ -62,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) @@ -71,9 +61,8 @@ 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 @@ -85,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) @@ -93,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"); } @@ -122,7 +111,7 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti source.AddRange(Enumerable.Range(1, initialItemCount)); var removeActionInvocations = new List(); - + // UUT Construction var subscription = source.Connect() .OnItemRemoved( @@ -130,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) @@ -139,9 +128,8 @@ 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 @@ -153,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) @@ -161,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"); } @@ -188,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) @@ -203,15 +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"); @@ -237,27 +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"); @@ -281,26 +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"); @@ -324,25 +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"); @@ -365,28 +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"); @@ -412,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( @@ -420,15 +403,14 @@ 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 @@ -439,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"); } @@ -458,33 +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"); } @@ -503,7 +484,7 @@ public void SourceCompletesAsynchronously_CompletionPropagates(bool invokeOnUnsu }); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved( @@ -511,23 +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 @@ -548,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( @@ -558,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 @@ -585,7 +565,7 @@ public void SourceFailsAsynchronously_CompletionPropagates(bool invokeOnUnsubscr }); var removeActionInvocations = new List(); - + // UUT Construction using var subscription = source.Connect() .OnItemRemoved( @@ -593,23 +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 @@ -631,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( @@ -641,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/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..6f29f7932 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,17 +24,15 @@ 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; public int CompareTo(ListItem? other) => DefaultComparer.Compare(this, other); - + } } 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..6ec0c5297 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 { @@ -49,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 887a230d4..00d91579d 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,26 +77,24 @@ 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); 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"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(item6); 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"); @@ -132,9 +114,8 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -156,12 +137,11 @@ 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"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -188,9 +168,8 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -212,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 +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); @@ -249,12 +226,11 @@ 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"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -262,12 +238,11 @@ 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"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -275,51 +250,47 @@ 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"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); 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"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); 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"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); 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"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); 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"); @@ -334,13 +305,12 @@ 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)) }; - // 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..59897b124 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 { @@ -52,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 55b1fdaae..7389c67e0 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 }); @@ -141,9 +122,8 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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); @@ -204,9 +183,8 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - - var scheduler = new TestScheduler(); + var scheduler = new TestScheduler(); // UUT Initialization & Action using var subscription = source @@ -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); @@ -326,13 +298,12 @@ 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)) }; - // 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..74765f85e 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 { @@ -94,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/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..6c3657e38 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> @@ -18,7 +15,7 @@ public CacheItemRecordingObserver(IScheduler scheduler) _recordedChangeSets = new(); _recordedItemsByKey = new(); _recordedItemsSorted = new(); - } + } public IReadOnlyList> RecordedChangeSets => _recordedChangeSets; 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..0be6c1698 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 @@ -31,7 +26,7 @@ public IDisposable Schedule( state: state, dueTime: null, action: action); - + public IDisposable Schedule( TState state, TimeSpan dueTime, @@ -40,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/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..750004469 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> @@ -15,7 +12,7 @@ public ListItemRecordingObserver(IScheduler scheduler) { _recordedChangeSets = new(); _recordedItems = new(); - } + } public IReadOnlyList> RecordedChangeSets => _recordedChangeSets; @@ -25,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/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..206667e9c 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 { @@ -27,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. @@ -41,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. @@ -254,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>( @@ -310,7 +299,7 @@ public static IObservable> ValidateChangeSets 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..818cdf1a4 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 { @@ -209,9 +201,9 @@ private static Action 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/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..35351693e 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 { @@ -34,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 4c7ce3a0e..8323773e7 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 @@ -52,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/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..927708eac 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 @@ -35,7 +27,7 @@ public IObservable CountChanged public IReadOnlyList Items => _source.Items; - + public IReadOnlyList Keys => _source.Keys; @@ -97,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 6f3a1e2c2..5ad04fb53 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 @@ -58,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), @@ -133,7 +126,7 @@ private IObservable WrapStream(IObservable sourceStream) { var hasCompleted = _hasCompleted .Publish(); - + var subscription = Observable .Merge( _error @@ -145,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(); 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 45b01bca7..a07d91609 100644 --- a/src/DynamicData/Attributes.cs +++ b/src/DynamicData/Attributes.cs @@ -2,6 +2,4 @@ // Roland 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")] 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 a34bf3e14..ed68fa83e 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 28eef90a2..b4181c951 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/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.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 60642ee29..35e30abc8 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..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,8 +9,23 @@ - + + + + + + + + + + + + + + + + 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;