}
@Test
public void testCharacterValueAnnotation() {
CharValuePojo pojo = factory.manufacturePojo(CharValuePojo.class);
Assert.assertNotNull("The pojo cannot be null!", pojo);
char charFieldWithMinValueOnly = pojo.getCharFieldWithMinValueOnly();
Assert.assertTrue(
"The char attribute with min value only should have a value greater than "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE,
charFieldWithMinValueOnly >= PodamTestConstants.NUMBER_INT_MIN_VALUE);
char charFieldWithMaxValueOnly = pojo.getCharFieldWithMaxValueOnly();
Assert.assertTrue(
"The char attribute with max value only should have a value less or equal than "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
charFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
char charFieldWithMinAndMaxValue = pojo
.getCharFieldWithMinAndMaxValue();
Assert.assertTrue(
"The char attribute with min and max value must have a value between "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE + " and "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
charFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_INT_MIN_VALUE
&& charFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
Character charObjectFieldWithMinValueOnly = pojo
.getCharObjectFieldWithMinValueOnly();
Assert.assertNotNull(
"The char object attribute with min value only cannot be null!",
charObjectFieldWithMinValueOnly);
Assert.assertTrue(
"The char object attribute with min value only should have a value greater than "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE,
charObjectFieldWithMinValueOnly >= PodamTestConstants.NUMBER_INT_MIN_VALUE);
Character charObjectFieldWithMaxValueOnly = pojo
.getCharObjectFieldWithMaxValueOnly();
Assert.assertNotNull(
"The char object attribute with max value only cannot be null!",
charObjectFieldWithMaxValueOnly);
Assert.assertTrue(
"The char object attribute with max value only should have a value less or equal than "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
charObjectFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
Character charObjectFieldWithMinAndMaxValue = pojo
.getCharObjectFieldWithMinAndMaxValue();
Assert.assertNotNull(
"The char object attribute with min and max value cannot be null!",
charObjectFieldWithMinAndMaxValue);
Assert.assertTrue(
"The char object attribute with min and max value must have a value between "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE + " and "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
charObjectFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_INT_MIN_VALUE
&& charObjectFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
char charFieldWithPreciseValue = pojo.getCharFieldWithPreciseValue();
Assert.assertTrue(
"The character field with precise value should have a value of "
+ PodamTestConstants.CHAR_PRECISE_VALUE,
charFieldWithPreciseValue == PodamTestConstants.CHAR_PRECISE_VALUE);
char charFieldWithBlankInPreciseValue = pojo
.getCharFieldWithBlankInPreciseValue();
Assert.assertTrue(
"The value for the char field with an empty char in the precise value and no other annotation attributes should be zero",
charFieldWithBlankInPreciseValue == 0);