Add overload to HaveElement() to be able to assert on occurrences for XDocument and XElement#1880
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 🙃 |
There was a problem hiding this comment.
📝 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.
There was a problem hiding this comment.
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 bec
CDA3
ause = "", params object[] becauseArgs)
} |
Yep |
This ref. #1681 and #1684
Closes #1681
Try to finish the work of @ABergBN
IMPORTANT