Package org.raml.model.parameter

Examples of org.raml.model.parameter.QueryParameter.validate()


        assertThat(priceParam.isRequired(), is(false));
        assertThat(priceParam.getDefaultValue(), is("23.50"));

        assertThat(priceParam.validate("0.15"), is(true));
        assertThat(priceParam.validate("0.05"), is(false));
        assertThat(priceParam.validate("75.57"), is(true));
        assertThat(priceParam.validate("99.92"), is(false));
    }

    @Test
    public void dateType()
View Full Code Here


        assertThat(priceParam.getDefaultValue(), is("23.50"));

        assertThat(priceParam.validate("0.15"), is(true));
        assertThat(priceParam.validate("0.05"), is(false));
        assertThat(priceParam.validate("75.57"), is(true));
        assertThat(priceParam.validate("99.92"), is(false));
    }

    @Test
    public void dateType()
    {
View Full Code Here

        assertThat(priceParam.getExample(), is("Sun, 06 Nov 1994 08:49:37 GMT"));
        assertThat(priceParam.isRepeat(), is(false));
        assertThat(priceParam.isRequired(), is(false));
        assertThat(priceParam.getDefaultValue(), is("Mon, 07 Nov 1994 11:23:41 GMT"));

        assertThat(priceParam.validate("Mon, 07 Nov 1994 11:23:41 GMT"), is(true));
        //assertThat(priceParam.validate("Lunes 5 de abril"), is(false));
    }

    @Test
    public void booleanType()
View Full Code Here

        assertThat(priceParam.getExample(), is("true"));
        assertThat(priceParam.isRepeat(), is(false));
        assertThat(priceParam.isRequired(), is(false));
        assertThat(priceParam.getDefaultValue(), is("false"));

        assertThat(priceParam.validate("true"), is(true));
        assertThat(priceParam.validate("false"), is(true));
        assertThat(priceParam.validate("yes"), is(false));
        assertThat(priceParam.validate("no"), is(false));
    }
View Full Code Here

        assertThat(priceParam.isRepeat(), is(false));
        assertThat(priceParam.isRequired(), is(false));
        assertThat(priceParam.getDefaultValue(), is("false"));

        assertThat(priceParam.validate("true"), is(true));
        assertThat(priceParam.validate("false"), is(true));
        assertThat(priceParam.validate("yes"), is(false));
        assertThat(priceParam.validate("no"), is(false));
    }

    @Test
View Full Code Here

        assertThat(priceParam.isRequired(), is(false));
        assertThat(priceParam.getDefaultValue(), is("false"));

        assertThat(priceParam.validate("true"), is(true));
        assertThat(priceParam.validate("false"), is(true));
        assertThat(priceParam.validate("yes"), is(false));
        assertThat(priceParam.validate("no"), is(false));
    }

    @Test
    public void defaultEnum()
View Full Code Here

        assertThat(priceParam.getDefaultValue(), is("false"));

        assertThat(priceParam.validate("true"), is(true));
        assertThat(priceParam.validate("false"), is(true));
        assertThat(priceParam.validate("yes"), is(false));
        assertThat(priceParam.validate("no"), is(false));
    }

    @Test
    public void defaultEnum()
    {
View Full Code Here

    @Test
    public void defaultEnum()
    {
        QueryParameter defaultEnum = getParameter("default-enum");
        assertThat(defaultEnum.validate("one"), is(true));
        assertThat(defaultEnum.validate("two"), is(true));
        assertThat(defaultEnum.validate("three"), is(false));
    }

    @Test
View Full Code Here

    @Test
    public void defaultEnum()
    {
        QueryParameter defaultEnum = getParameter("default-enum");
        assertThat(defaultEnum.validate("one"), is(true));
        assertThat(defaultEnum.validate("two"), is(true));
        assertThat(defaultEnum.validate("three"), is(false));
    }

    @Test
    public void validate()
View Full Code Here

    public void defaultEnum()
    {
        QueryParameter defaultEnum = getParameter("default-enum");
        assertThat(defaultEnum.validate("one"), is(true));
        assertThat(defaultEnum.validate("two"), is(true));
        assertThat(defaultEnum.validate("three"), is(false));
    }

    @Test
    public void validate()
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.