fixed Obligation#value

Obligation#value now waits correctly when state is not completed
Added unit test for Obligation