Trditve so izjave v testu, ki preverijo, ali je pogoj resničen — preverjajo, da se dejanskega rezultat ujema s pričakovanim rezultatom. So jedro tega, kako testi določijo uspeh ali neuspeh: če trditev ne uspe, test ne uspe.
Kaj trditve delajo
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).
Splošne vrste trditev
(result).();
(obj).({ : });
(value).();
(value).();
(value).();
(count).();
(price).();
(array).();
(array).();
(text).();
( ()).();
(value)..();
