use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElement_ComponentElement_Test.
@Test
public void toElement_ComponentElement_Test() {
final Ds3Element ds3Element = new Ds3Element("TestElement", "array", "java.lang.Integer", true);
final NetNullableVariable result = generator.toElement(ds3Element, ImmutableMap.of());
assertThat(result.getName(), is("TestElement"));
assertThat(result.getNetType(), is("IEnumerable<int>"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElementsList_FullList_Test.
@Test
public void toElementsList_FullList_Test() {
final ImmutableList<Ds3Annotation> optionalAnnotation = ImmutableList.of(new Ds3Annotation("com.spectralogic.util.bean.lang.Optional", null));
final ImmutableList<Ds3Element> ds3Elements = ImmutableList.of(new Ds3Element("Element1", "java.lang.Integer", null, false), new Ds3Element("Element2", "java.lang.Integer", null, optionalAnnotation, true), new Ds3Element("Element3", "array", "java.lang.Integer", false));
final ImmutableList<NetNullableVariable> result = generator.toElementsList(ds3Elements, ImmutableMap.of());
assertThat(result.size(), is(3));
assertThat(result.get(0).getName(), is("Element1"));
assertThat(result.get(0).getNetType(), is("int"));
assertThat(result.get(1).getName(), is("Element2"));
assertThat(result.get(1).getNetType(), is("int?"));
assertThat(result.get(2).getName(), is("Element3"));
assertThat(result.get(2).getNetType(), is("IEnumerable<int>"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toElement_SimpleElement_Test.
@Test
public void toElement_SimpleElement_Test() {
final Ds3Element ds3Element = new Ds3Element("TestElement", "java.lang.Integer", null, false);
final NetNullableVariable result = generator.toElement(ds3Element, ImmutableMap.of());
assertThat(result.getName(), is("TestElement"));
assertThat(result.getNetType(), is("int"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class NetNullableVariableUtils_Test method createNullableVariable_NullableEnum_Test.
@Test
public void createNullableVariable_NullableEnum_Test() {
final NetNullableVariable var = createNullableVariable("Name", "TestEnumType", true, getTestTypeMap());
assertThat(var.getNetType(), is("TestEnumType?"));
}
use of com.spectralogic.ds3autogen.net.model.common.NetNullableVariable in project ds3_autogen by SpectraLogic.
the class NetNullableVariableUtils_Test method createNullableVariable_NullableSpectraType_Test.
@Test
public void createNullableVariable_NullableSpectraType_Test() {
final NetNullableVariable var = createNullableVariable("Name", "TestElementType", true, getTestTypeMap());
assertThat(var.getNetType(), is("TestElementType"));
}
Aggregations