Package org.jbehave.core.steps.ParameterConverters

Examples of org.jbehave.core.steps.ParameterConverters.BooleanConverter.convertValue()


        assertThat(converter.accept(Boolean.TYPE), equalTo(true));
        assertThat(converter.accept(Boolean.class), equalTo(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("true", type), is(true));
        assertThat((Boolean) converter.convertValue("false", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @Test
View Full Code Here


        assertThat(converter.accept(Boolean.class), equalTo(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("true", type), is(true));
        assertThat((Boolean) converter.convertValue("false", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @Test
    public void shouldConvertBooleanWithCustomValues() throws IntrospectionException {
View Full Code Here

        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("true", type), is(true));
        assertThat((Boolean) converter.convertValue("false", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @Test
    public void shouldConvertBooleanWithCustomValues() throws IntrospectionException {
        ParameterConverter converter = new BooleanConverter("ON", "OFF");
View Full Code Here

        assertThat(converter.accept(Boolean.TYPE), equalTo(true));
        assertThat(converter.accept(Boolean.class), equalTo(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("ON", type), is(true));
        assertThat((Boolean) converter.convertValue("OFF", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @SuppressWarnings("unchecked")
View Full Code Here

        assertThat(converter.accept(Boolean.class), equalTo(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("ON", type), is(true));
        assertThat((Boolean) converter.convertValue("OFF", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @SuppressWarnings("unchecked")
    @Test
View Full Code Here

        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithBoolean").getGenericParameterTypes()[0];
        assertThat((Boolean) converter.convertValue("ON", type), is(true));
        assertThat((Boolean) converter.convertValue("OFF", type), is(false));
        assertThat((Boolean) converter.convertValue("whatever", type), is(false));
    }

    @SuppressWarnings("unchecked")
    @Test
    public void shouldConvertBooleanList() throws IntrospectionException {
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.