Package org.jbehave.core.steps.ParameterConverters

Examples of org.jbehave.core.steps.ParameterConverters.EnumConverter


    }
   
    @Test
    public void shouldConvertEnum() throws IntrospectionException {
        ParameterConverter converter = new EnumConverter();
        assertThat(converter.accept(SomeEnum.class), equalTo(true));
        assertThat(converter.accept(WrongType.class), is(false));
        assertThat(converter.accept(mock(Type.class)), is(false));
        Type type = SomeSteps.methodFor("aMethodWithEnum").getGenericParameterTypes()[0];
        assertThat((SomeEnum) converter.convertValue("ONE", type), equalTo(SomeEnum.ONE));
    }
View Full Code Here


    }
   
   
    @Test(expected = ParameterConvertionFailed.class)
    public void shouldFailToConvertEnumForValueNotDefined() throws IntrospectionException {
        ParameterConverter converter = new EnumConverter();
        Type type = SomeSteps.methodFor("aMethodWithEnum").getGenericParameterTypes()[0];
        converter.convertValue("FOUR", type);
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.steps.ParameterConverters.EnumConverter

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.