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
Refactor the backstab unit test #6473
Conversation
I'm not very familiar with WML tests but as a general rule I try to write self-descriptive names for the tests in preference to overly-long explanatory comments as the latter can become out of date as code/tests are updated. As I recall, back-stab doubles damage for the attacker when an attacker's ally is directly opposite the defender. But it looks like the test names are pre-existing and I assume they haven't been changed to avoid breaking tests. It makes sense to me to have the test focus on the activation of the back-stab damage bonus vs checking arbitrary damage values in the parameters as the latter seems more prone to errors. |
It would be easy to change the tests' names too, please provide better suggestions. |
I don't know what the convention is, but if I understood the tests correctly I was thinking along the lines of:
A bit long, I know, but at least it should be clear to a newcomer what the tests are checking for. |
A bit shorter (haven't pushed it yet, still pondering):
|
As long as people reading can quickly and easily understand the intent of the test solely by looking at the test name. I find that's generally easier to accomplish when being a bit more verbose but whatever works. |
Based on Pentarctagon's documentation addition, and also improving the encapsulation of the test to take a boolean value for whether the ability should be active instead of the expected damage total.
Are the ones that I posted clear to you, or not? |
It should be fine - definitely an improvement over the original anyway. |
835e1a5
to
dfb9598
Compare
@Pentarctagon, is this OK for you? |
Based on part of Pentarctagon's #6308, and also improving
the encapsulation of the test to take a boolean value for whether
the ability should be active instead of the expected damage total.