Replies: 4 comments 5 replies
-
Thank you for raising this discussion. I actually remembered that I regretted my choice to go for |
Beta Was this translation helpful? Give feedback.
-
Same here :) If a test only should be true, why are we testing ;) A test IMHO have to be a particular scenario which have to pass... otherwise this test is useless |
Beta Was this translation helpful? Give feedback.
-
Q1: I'm often conservative about changes (my comments across issues and PRs will confirm), but renaming
I don't think the change outweights what it breaks. Q2: If you intend to proceed with making extension methods, I'm much open to see if we can adjust/extend the caller identification code to support using |
Beta Was this translation helpful? Give feedback.
-
Apologies for the duplication. I submitted an issue on this (#1922) and then resized that discussions are active for this project, so re-posting here. Not sure what the maintainers consider the more appropriate place, so sorry for the dup.
Background
This is not a bug, but rather a question / suggestion for the future. :)
Fluent Assertions is a brilliant framework. I am glad that it exists and I am grateful to the authors.
There is one thing about it that bugs me a lot. It is likely just due to my being overly compulsive about naming things in a deliberate and correct manner, yet I would be very interested and grateful to to learn whether there are others who feel similar. :)
My question is about a central concept of Fluent Assertions: the
Should(..)
method.Fluent Assertions does an amazing job making assertions read easily. Yet, a test case is also a "specification" of how the tested code is expected to behave. And, there exists a de-factor standard that describes guidelines for the English words to use in requirements specifications: the infamous RFC 2119.
Based on that, what Fluent Assertions expresses using
Should(..)
, MUST really me expressed using the verb "must".For those who are not familiar, the aforementioned RFC is extremely short, check it out. The relevant part is:
Question 1: History
I am curious to learn the authors' thoughts on this topic. Did the choice
Should(..)
vs.Must(..)
come up explicitly in the early days of Fluent Assertions? If yes, what were the reasons for the choice taken? Or was it the case that by the time this came up, there was already so much code in the wild based onShould(..)
that a change could not be realistically considered for compatibility reasons? Or, perhaps, I am the only one worried about it? :)Question 2: Future / Adjustments
Assume that after learning some of the background in question 1 I wanted to use RFC-2119-style working in my own assertions, i.e. I wanted to replace
Should(..)
withMust(..)
. Assume also that I wanted to share the solution for doing that with the community in case other people like that idea and want to apply it in a way that does not disrupt Fluent Assertions at its core.In the context of the fact that I am in no way an exert on the internals of Fluent Assertions, would the authors (or any of the experts) have some guidance on the implementation strategy?
Based on a first looks, it seems that it may be possible to duplicate the AssertionExtensions class and to define a
Must(..)
equivalent for every of theShould(..)
overloads found there.If I did so,
Should(..)
version,Should(..)
without actually calling into it?Would such an approach break anything around the stack walks done by the framework?
Are there any other gotchas I should expect?
Would there be any interest in including such an optional extension in some way into Fluent Assertions directly? Perhaps tucked away into a sub-namespace or in some other non-disruptive manner?
If this whole topic a crazy idea? :)
Conclusion
I realize that people are busy. I respect your time and because of that I am ever more grateful for any feedback I might get from
Fluent Assertions experts on this topic.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions