Skip to content
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

Develop Testing naming convetion. #883

Open
LuisPH3 opened this issue Oct 17, 2024 · 0 comments
Open

Develop Testing naming convetion. #883

LuisPH3 opened this issue Oct 17, 2024 · 0 comments

Comments

@LuisPH3
Copy link
Contributor

LuisPH3 commented Oct 17, 2024

As discussed in #878

I would even go one step further and propose a pattern for the property to tested. Thus, a name should be something like

[TestTarget_SituationUnderTest_ExpectedBehavior]

So, for instance here,

TestSelfDestruct_SuccessfulInvocation_ReturnsSelfdestructedStateAndConsumesGas

This might be a bit long, but I think it documents well what this test does. In contrast, a test checking for failure states would be named like

TestSelfDestruct_InsufficientGas_ReturnsStopStateAndError

If the SituationUnderTest is obvious, it may be omitted.

Originally posted by @HerbertJordan in #878 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant