unit tests for class contract