* You can pick and choose specific scenarios and test EXACTLY what you wanna test at a given moment.
* You get the shortest testing time since you don't have to "pre-run" the first scenario before running the overdraft scenario or You don't have to wait for the overdraft scenario to finish for to get the PASS from the first scenario.
Nice post, and I agree in general, but sometimes the issue is in chain of things, like in this case maybe after a failed attempt setting overdraft limit and re-try will not work. I would say check it in isolation and also have basic scenarios checked as well.
Thanks well done, took me some time for me to understand Usd(5); might be better to use Java Lib. improve readability: java.util.Currency usd = java.util.Currency.getInstance("USD");
As a general rule, Helper methods should be avoided because it scatters context. Duplicating the helper method body inside the test cases is Ok as it gives all the context necessary to understand the test case.
More benefits:
OdpovedaťOdstrániť* You can pick and choose specific scenarios and test EXACTLY what you wanna test at a given moment.
* You get the shortest testing time since you don't have to "pre-run" the first scenario before running the overdraft scenario or You don't have to wait for the overdraft scenario to finish for to get the PASS from the first scenario.
Nice post, and I agree in general, but sometimes the issue is in chain of things, like in this case maybe after a failed attempt setting overdraft limit and re-try will not work.
OdpovedaťOdstrániťI would say check it in isolation and also have basic scenarios checked as well.
Thanks well done, took me some time for me to understand Usd(5); might be better to use Java Lib. improve readability:
OdpovedaťOdstrániťjava.util.Currency usd = java.util.Currency.getInstance("USD");
Nice post. Just the kind of information I was searching for.
OdpovedaťOdstrániťNitpicky but missing "a" in "account" in the first code example.
EXPECT_THAT(ccount_.Withdraw(Usd(1)), IsOk());
Fixed. Thanks!
OdpovedaťOdstrániťAs a general rule, Helper methods should be avoided because it scatters context.
OdpovedaťOdstrániťDuplicating the helper method body inside the test cases is Ok as it gives all the context necessary to understand the test case.