Am 28.02.2015 19:32 schrieb "Crypto Compress" <cryptocompr...@googlemail.com
>:
>
> class BankAccount {
>     function Add($amount) {
>         assert($amount > 0);
>         // ... code block ...
>     }
> }
>
> Now the programmer implementing "code block" to gracefully handle $amount
> 0 has a problem. There is no way to (Unit)test failing path on
development machine. Code after assertion is never called for failing
contitions. What to do?

Put the assert AFTER handling the always-to-be-done validation, of course.
Doesn't make sense otherwise.

Patrick

Reply via email to