-
Notifications
You must be signed in to change notification settings - Fork 733
Add overload to HaveElement() to be able to assert on occurrences for XDocument and XElement
#1880
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
Conversation
Pull Request Test Coverage Report for Build 2100620689Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
Maybe using the |
HaveElementCount() and HaveSingleElement() for XDocumentHaveElement() to be able to assert on occurrences and add HaveSingleElement() for XDocument
|
It's a bit difficult to review, when the APIs keep changing 😉 We are trying to formalize the process of changes a bit, such that larger changes are first discussed in an issue before opening a PR. We haven't fully set on the process, but these links should provide a feeling of it, notably excluding the amount of manpower we can allocate. |
|
This PR just finishes an already discussed feature. ahh.. and btw. This state is my „final“ change 🙃 |
dennisdoomen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 I leave a code review comment only once and assume that similar code needs similar improvements.
🤔 For consistency, we also need to add those new members to XElementAssertions.
jnyrup
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it seems you like to learn about our process.
You're not "just" continuing another PR when you change the API. ℹ️
The main reason I asked about discussing the API again, was because I like the usage of OccurrenceConstraint and had ideas to improve it even more 🚀
Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt
Outdated
Show resolved
Hide resolved
Tests/Approval.Tests/ApprovedApi/FluentAssertions/net47.verified.txt
Outdated
Show resolved
Hide resolved
401ec08 to
5b1ae03
Compare
HaveElement() to be able to assert on occurrences and add HaveSingleElement() for XDocumentHaveElement() to be able to assert on occurrences and add HaveSingleElement() for XDocument and XElement
|
@dennisdoomen What do you think: Should I remove the |
I have to admit I agree. The only case where it would read fluent if there was a parameterless |
|
Is the the API change we can agree on? class XDocumentAssertions
{
+ AndWhichConstraint<XDocumentAssertions, IEnumerable<XElement>> HaveElement(string expected, OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs)
+ AndWhichConstraint<XDocumentAssertions, IEnumerable<XElement>> HaveElement(XName expected, OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs)
}
class XElementAssertions
{
+ AndWhichConstraint<XElementAssertions, IEnumerable<XElement>> HaveElement(string expected, OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs)
+ AndWhichConstraint<XElementAssertions, IEnumerable<XElement>> HaveElement(XName expected, OccurrenceConstraint occurrenceConstraint, string because = "", params object[] becauseArgs)
} |
Yep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move release notes to the appropriate section
and/or rebase to current develop
This ref. #1681 and #1684
Closes #1681
Try to finish the work of @ABergBN
IMPORTANT