Skip to content

Postcondition

KuSpa edited this page Feb 16, 2018 · 3 revisions

What is a Postcondition?

A Postcondition is a Block testing the promised execution of the Contract / Method. The Postcondition provides two parameter for testing that: a Snapshot of the old Objectstate and the new ObjectState. Please keep in mind that the used copy Method may differ from class to class.

Examples

Text>>append:

[ :newObj :oldObj |
   newObj assert:[newObj beginsWith: oldObj].
   newObj assert:[newObj size >= oldObj size].
]
Clone this wiki locally