unit tests for method contract