Search in sources :

Example 1 with WrappedPrimitiveType

use of org.robobinding.codegen.apt.type.WrappedPrimitiveType in project RoboBinding by RoboBinding.

the class SimpleOneWayPropertyInfoTest method givenPrimitivePropertyType_thenReturnBoxedType.

@Test
public void givenPrimitivePropertyType_thenReturnBoxedType() {
    final SetterElement setter = context.mock(SetterElement.class);
    final WrappedPrimitiveType primitiveType = context.mock(WrappedPrimitiveType.class);
    context.checking(new Expectations() {

        {
            oneOf(setter).parameterType();
            will(returnValue(primitiveType));
            oneOf(primitiveType).isPrimitive();
            will(returnValue(true));
            oneOf(primitiveType).boxedClassName();
            will(returnValue(Integer.class.getName()));
        }
    });
    SimpleOneWayPropertyInfo info = new SimpleOneWayPropertyInfo(setter);
    assertThat(info.propertyType(), equalTo(Integer.class.getName()));
}
Also used : Expectations(org.jmock.Expectations) SetterElement(org.robobinding.codegen.apt.element.SetterElement) WrappedPrimitiveType(org.robobinding.codegen.apt.type.WrappedPrimitiveType) Test(org.junit.Test)

Aggregations

Expectations (org.jmock.Expectations)1 Test (org.junit.Test)1 SetterElement (org.robobinding.codegen.apt.element.SetterElement)1 WrappedPrimitiveType (org.robobinding.codegen.apt.type.WrappedPrimitiveType)1