add tests for class validity