A software developer. I'm interested in learning new technologies and core language features. I love to dive into legacy code writing tests and refactoring as I go.
Yes! I think the same style could also be done in junit but it probably wouldn't pass a review. I do think that junit provides some nice ways to remove verbose code and just declare the parameters you want in the test. In some cases it is probably just better not to use it though. It depends on how common the code is and how much time is saves.
In graphs I was able to take advantage of these features in junit here, for example, but it is not for everyone.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi John and thank you for the kind words.
Right !
To achieve the same using the host language's constructs, you could:
1. define a package-level variable with the various cases:
2. generate the test cases from a function
3. load the test cases from a JSON/Yaml/CSV/.. file
Again, you have the full standard library to achieve whatever you need :)
Yes! I think the same style could also be done in junit but it probably wouldn't pass a review. I do think that junit provides some nice ways to remove verbose code and just declare the parameters you want in the test. In some cases it is probably just better not to use it though. It depends on how common the code is and how much time is saves.
In graphs I was able to take advantage of these features in junit here, for example, but it is not for everyone.