-
Notifications
You must be signed in to change notification settings - Fork 179
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
Provide way to assert completed calls without using Repeated class #1292
Comments
I wonder if the names could be improved. I guess So we would have this instead:
What do you think? |
Ah, I just realized the names you had suggested are consistent with |
2 minutes before I push my "final" changes you come up with this? You're killing me, Levesque. Idiom is in the ear of the beholder, but I'd agree that "once exactly" is slightly less natural than "exactly once". On the other hand, I see you just commented with the response I was going to make. |
So... which is more important? Being idiomatic, or being consistent? I'd say consistent is more important (in which case we can keep the names you suggested) |
I think being consistent is enough of a benefit to compensate for the sightly stilted phrasing. At least names like |
This change has been released as part of FakeItEasy 4.4.0. Thanks for your help with this, @jholovacs. Look for your name in the release notes! 🏆 |
@blairconrad I would like to understand why you aren't deprecating the APIs right now. |
@Mertsch, by all means guide people to the new APIs. I would. The main reason we did not deprecate the APIs yet is that that can be considered a breaking change. It's common in the OSS framework ecosystemcitation needed to deprecate an API in a major release and remove it in the following major release. Accordingly, we should deprecate in 5.0.0 and remove in 6.0.0. We don't yet have any timing around a 5.0.0 release, but it is something we could investigate. |
@blairconrad OK, if that is common practice, I would have expected to mark
Thanks for the explanation 👍 |
One concern I'd have with deprecating in 4.4.0 is that any consumers of the old API who have |
As mentioned by @jholovacs in #808, the
Repeated
inA.CallTo(() => f.Boo()).MustHaveHappened(Repeated.Exactly.Once)
could be construed as meaning "Boo must have happened, and then it must have been repeated, for a total of two calls". After much discussion, we've resolved to provide alternative methods and eventually deprecate and removeRepeated
.As noted in that issue, we'll introduce the following API:
Times
is a new class.This satisfies the following goals:
Repeated
MustHaveHappened()
andMustNotHaveHappened()
, which are the most popular methods in use todayRepeated
mechanismRepeated.Times(3)
)int
MustHaveHappened(3).Times
, where theTimes
could be forgotten)Repeated
variants can live for a major release or two and be deprecated in 5.0.0 and removed in 6.0.0.The text was updated successfully, but these errors were encountered: