def test_setFixedLength_alters_accepted_lenth(self): validator = FloatArrayLengthValidator() self.assertFalse(validator.hasLength()) fixed = 5 validator.setLength(fixed) self.assertTrue(validator.hasLength()) self.assertEqual(validator.getLength(), fixed) validator.clearLength() self.assertFalse(validator.hasLength())
def test_setFixedLength_alters_accepted_lenth(self): validator = FloatArrayLengthValidator() self.assertFalse(validator.hasLength()) fixed = 5 validator.setLength(fixed) self.assertTrue(validator.hasLength()) self.assertEquals(validator.getLength(), fixed) validator.clearLength() self.assertFalse(validator.hasLength())
def test_fixed_length_constructor_return_hasLength(self): fixedlength = 9 validator = FloatArrayLengthValidator(fixedlength) self.assertTrue(validator.hasLength()) self.assertEqual(validator.getLength(), fixedlength)
def test_empty_constructor_has_no_lengths_set(self): validator = FloatArrayLengthValidator() self.assertFalse(validator.hasLength()) self.assertFalse(validator.hasMinLength()) self.assertFalse(validator.hasMaxLength())
def test_fixed_length_constructor_return_hasLength(self): fixedlength = 9 validator = FloatArrayLengthValidator(fixedlength) self.assertTrue(validator.hasLength()) self.assertEquals(validator.getLength(), fixedlength)