use of org.robobinding.codegen.apt.type.TypeMirrorWrapper in project RoboBinding by RoboBinding.
the class ElementWrapper method create.
public static ElementWrapper create(Types types, Elements elements, Messager messager) {
TypeMirrorWrapper typeWrapper = new TypeMirrorWrapper(types, elements);
ElementWrapper elementWrapper = new ElementWrapper(typeWrapper, new MessagerLoggerFactory(messager), types, elements);
return elementWrapper;
}
use of org.robobinding.codegen.apt.type.TypeMirrorWrapper in project RoboBinding by RoboBinding.
the class ElementWrapperTest method whenWrapSupportedElements_thenReturnCoorespondingWrappedInstance.
@Theory
public void whenWrapSupportedElements_thenReturnCoorespondingWrappedInstance(@FromDataPoints("supportedElements") ElementToWrapped elementToWrapped) {
Mockery context = new ClassMockery();
final TypeMirrorWrapper typeWrapper = context.mock(TypeMirrorWrapper.class);
context.checking(new Expectations() {
{
allowing(typeWrapper).wrap(with(any(TypeMirror.class)));
will(returnValue(null));
}
});
ElementWrapper wrapper = new ElementWrapper(typeWrapper, null, null, null);
AbstractWrappedElement wrapped = wrapper.wrap(elementToWrapped.element);
assertThat(wrapped, isA(elementToWrapped.wrappedType));
}
Aggregations