Replies: 1 comment
-
|
Thanks for the suggestion. It does feel a bit niche. And even if it would be useful to a broader audience, it would need to follow the same semantics (API look-and-feel) as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using ChatGPT and some manual tries I have created a simple FluentAssertion extension that can assert all properties are non-null in an object (recursively):
Usage:
Multiple properties:
Or e.g. by type:
or by custom attribute:
Maybe that is useful? What do you think about it?
I found no easier solution to assert this.
BeEquivalentTois not really possible even though ChatGPT first tried desperately (withUsingand.When(info => true)orWhenTypeIs<object>()but these all don't work, because they are restricted to a generic type).So I guess using reflection is the only choice here, is not it?
I tried making ChatGPT adjust it more to the
.Excludingsyntax ofBeEquivalentTooptions, but that did not work, and, after alll, is also not that important.Beta Was this translation helpful? Give feedback.
All reactions