Package uk.co.jemos.podam.test.dto.annotations

Examples of uk.co.jemos.podam.test.dto.annotations.CharValuePojo


  }

  @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);
View Full Code Here

TOP

Related Classes of uk.co.jemos.podam.test.dto.annotations.CharValuePojo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.