Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Inspect sorted items through SortedChangeSetAggregator #820

Open
JakenVeina opened this issue Jan 5, 2024 · 1 comment
Open

Comments

@JakenVeina
Copy link
Collaborator

JakenVeina commented Jan 5, 2024

There is currently no way to test for sorting when using .AsAggregator() upon an ISortedChangeSet<TObject, TKey> stream.

Soemthing along the lines of...

using var source = new SourceCache<int, int>(x => x);

using var results = source
    .Sort(Comparer<int>.Default)
    .AsAggregator();
    
source.AddOrUpdate(3);
source.AddOrUpdate(2);
source.AddOrUpdate(1);

results.SortedItems.Should().BeEquivalentTo(new[] { 1, 2, 3 }, options => options.WithStrictOrdering());
@JakenVeina
Copy link
Collaborator Author

With #870 merged, this could potentially be implemented by deprecating the existing Aggregator classes, and publicizing the RecordingObserver classes, since they include this functionality already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant