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

Incoherency in SpecEventStorage --> Get<T> #16

Closed
pierrus opened this issue Mar 22, 2017 · 2 comments
Closed

Incoherency in SpecEventStorage --> Get<T> #16

pierrus opened this issue Mar 22, 2017 · 2 comments

Comments

@pierrus
Copy link

pierrus commented Mar 22, 2017

public IEnumerable<IEvent> Get<T>(Guid aggregateId, int fromVersion)
        {
            return Events.Where(x => x.Version > fromVersion);
        }

Is it voluntary that the x.Id == aggregateId is omitted in the event storage test component / Get method ? It causes an EventsOutOfOrderException due to the fact that I initialize a test with 2 events in the Given() method, targeting 2 different aggregates.

Updating the method to the following corrected the issue:

public IEnumerable<IEvent> Get<T>(Guid aggregateId, int fromVersion)
        {
            return Events.Where(x => x.Version > fromVersion && x.Id == aggregateId);
        }
@gautema
Copy link
Owner

gautema commented Mar 22, 2017

You are right. There is a bug here. I submit a fix within a few hours.

@gautema
Copy link
Owner

gautema commented Mar 22, 2017

This is fixed i master now. No reason it was the way it was other than the fact that I have only used it to test one aggregate.

@gautema gautema closed this as completed Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants