Skip to content

Failing test using ienumerable for #1874 #1876

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

Closed
wants to merge 2 commits into from

Conversation

danspam
Copy link
Contributor

@danspam danspam commented Oct 17, 2018

Failing test for #1874, as requested

{
gavin = s.Get<User>("gavin");
widget = s.Get<Widget>("widg1");
//Assert.IsTrue(gavin.Widgets.Any(w => w == widget));

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

@hazzik
Copy link
Member

hazzik commented Oct 17, 2018

thanks

@hazzik
Copy link
Member

hazzik commented Oct 17, 2018

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Oct 18, 2018

Thanks,

It seems to me the key point is using Any instead of Contains: I can reproduce the trouble in OrphanDelete by just changing this.

So the test case changes can be minimized to just duplicating OrphanDelete in something like OrphanDeleteWithAnyCheck in which Contains calls are replaced by Any equivalent calls.

Update: well, under the hood, there are additional differences with your test case. Your Widget class provides a GetHashCode and Equals implementation, which Document does not. With the extra lazy current implementation, it looks easier to fix the case when a proper GetHashCode and Equals implementation is available.

@hazzik
Copy link
Member

hazzik commented Oct 21, 2018

Replaced by #1878

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

Successfully merging this pull request may close these issues.

3 participants