Assertions huma statements fi test li jivverifikaw jekk kundizzjoni hija vera — jiċċekkjaw li r-riżultat attwali jaqbel mar-riżultat mistennija. Huma l-qalba ta' kif it-tests jiddeterminaw pass jew fail: jekk assertion ifalli, it-test ifalli.
X'jagħmlu l-assertions
An ASSERTION checks that something is as expected:
→ "assert that the actual value EQUALS the expected value"
→ if TRUE → the assertion passes; if FALSE → the assertion FAILS → the TEST FAILS
→ Assertions are how a test VERIFIES behavior (the "check" part of a test).
Tipi ta' assertions komuni
(result).();
(obj).({ : });
(value).();
(value).();
(value).();
(count).();
(price).();
(array).();
(array).();
(text).();
( ()).();
(value)..();
