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
Add feature to check if an XElement or XAttribute is absent within the XDocument #2589
Comments
Sure, makes sense. What do you think @jnyrup ? |
It certainly makes sense to have more negated assertions for XML types 👍 You suggest adding an overload of We currently have
and
In order to have a consistent API, it would be be nice to add the proposed methods on all relevant classes. |
Hey @jnyrup and @dennisdoomen Thanks for the reply, should I implement the changes according to your guidelines and create another PR? (I mean, I really need this extension because I have a dirty workaround for my problem (I've added a BG Sergej |
Everything that is in this proposal should be delivered as a consistent set of changes. And to prevent contributors from abandoning the work after the first PR, we need to insist on contributors to provide a PR that covers everything that is needed to maintain that consistency. Hope you understand. |
It took me a couple of seconds to realize that In that case, we need:
To be clear, you can only add the
|
Background and motivation
Currently, there is an implementation to check whenever an Attribute or Element is within the Document: https://fluentassertions.com/xml/
However, sometimes it is necessary to check if those attributes are absent. Currently, there is no possibility to do this. Maybe it would be possible to use the HaveElement() Method and catch the Exception, but this feels dirty.
I think it could also be a good idea, to add a constraint if the attribute/element does not have a specific value
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
Are you willing to help with a proof-of-concept (as PR in that or a separate repo) first and as pull-request later on?
Yes, please assign this issue to me.
The text was updated successfully, but these errors were encountered: