Tests for entity rule validation