Made some refactoring.
Added a test for checking if precondition failure occurs. Added also TestHelper class.