Tests for validate method