This is the official forum for our book, Android Test-Driven Development by Tutorials, available here: https://store.raywenderlich.com/products/android-test-driven-development-by-tutorials.
Hi. Chapter 7 - Introduction to Mockito
Possibly trivial and maybe it’s just me but in the
CocktailsApi classes, I do not find the method’s name
getAlcoholic() to be self-explanatory, but rather confusing. As it is getting the cocktails from the API, I was wondering why it was not called
getCocktails() for instance, which I think would help with reading/understanding the code and keep the focus where it should be.
It is only when I had a look at TheCocktailDB API documentation that I discovered you could fetch alcoholic or non-alcoholic cocktails and that the name
getAlcoholic() suddenly made sense.
However, given that it’s just a tutorial on testing here, not on fetching data from an API (hence no need to check the documentation to understand it), maybe renaming that method would be worth considering (
getAlcoholicCocktails()?) to keep the flow. Thank you