Skip to content

Conversation

@dennisdoomen
Copy link
Member

Fixes #919

@dennisdoomen dennisdoomen force-pushed the Fix/PropertyChangeMessageImprovement branch from 788ccf6 to 794870d Compare May 25, 2020 05:25
@dennisdoomen dennisdoomen requested a review from jnyrup May 25, 2020 05:25
var actualPropertyNames = recording
.SelectMany(@event => @event.Parameters.OfType<PropertyChangedEventArgs>())
.Select(@args => @args.PropertyName)
.Distinct()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a tests that exercises the distinctiveness?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think changed test exercises the call to Distinct. Such a test would need to raise the same event twice and check that the failure message only contains the name of the event once.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted the test.

return recording.WithArgs<PropertyChangedEventArgs>(args => args.PropertyName == propertyName);
var actualPropertyNames = recording
.SelectMany(@event => @event.Parameters.OfType<PropertyChangedEventArgs>())
.Select(@args => @args.PropertyName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.Select(@args => @args.PropertyName)
.Select(arg => arg.PropertyName)

@dennisdoomen dennisdoomen force-pushed the Fix/PropertyChangeMessageImprovement branch from 794870d to b4ee584 Compare May 25, 2020 18:24
@dennisdoomen dennisdoomen requested a review from jnyrup May 25, 2020 18:25
@dennisdoomen dennisdoomen force-pushed the Fix/PropertyChangeMessageImprovement branch from b4ee584 to 9da570b Compare May 25, 2020 18:46
@dennisdoomen dennisdoomen merged commit e06d122 into fluentassertions:develop May 26, 2020
@dennisdoomen dennisdoomen deleted the Fix/PropertyChangeMessageImprovement branch May 26, 2020 05:16
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

Successfully merging this pull request may close these issues.

RaisePropertyChangeFor produces unhelpful failure message

2 participants