use of com.spectralogic.ds3autogen.net.model.type.EnumConstant in project ds3_autogen by SpectraLogic.
the class NoneEnumGenerator_Test method toEnumConstants_FullList_Test.
@Test
public void toEnumConstants_FullList_Test() {
final ImmutableList<Ds3EnumConstant> enumConstants = ImmutableList.of(new Ds3EnumConstant("one", null), new Ds3EnumConstant("two", null), new Ds3EnumConstant("three", null));
final ImmutableList<EnumConstant> result = generator.toEnumConstantsList(enumConstants);
assertThat(result.size(), is(4));
assertThat(result.get(0).getName(), is("one"));
assertThat(result.get(1).getName(), is("two"));
assertThat(result.get(2).getName(), is("three"));
assertThat(result.get(3).getName(), is("NONE"));
}
use of com.spectralogic.ds3autogen.net.model.type.EnumConstant in project ds3_autogen by SpectraLogic.
the class NetHelper_Test method getEnumValues_FullList_Test.
@Test
public void getEnumValues_FullList_Test() {
final String expected = "one,\ntwo,\nthree";
final ImmutableList<EnumConstant> enumConstants = ImmutableList.of(new EnumConstant("one"), new EnumConstant("two"), new EnumConstant("three"));
final String result = getEnumValues(enumConstants, 0);
assertThat(result, is(expected));
}
use of com.spectralogic.ds3autogen.net.model.type.EnumConstant in project ds3_autogen by SpectraLogic.
the class NoneEnumGenerator method toEnumConstantsList.
/**
* Converts a list of Ds3EnumConstants into a list of Enum Constants and
* adds the enum constant NONE
*/
@Override
public ImmutableList<EnumConstant> toEnumConstantsList(final ImmutableList<Ds3EnumConstant> ds3EnumConstants) {
final ImmutableList.Builder<EnumConstant> builder = ImmutableList.builder();
builder.addAll(getEnumConstantsList(ds3EnumConstants));
builder.add(new EnumConstant("NONE"));
return builder.build();
}
use of com.spectralogic.ds3autogen.net.model.type.EnumConstant in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method getEnumConstants_FullList_Test.
@Test
public void getEnumConstants_FullList_Test() {
final ImmutableList<Ds3EnumConstant> enumConstants = ImmutableList.of(new Ds3EnumConstant("one", null), new Ds3EnumConstant("two", null), new Ds3EnumConstant("three", null));
final ImmutableList<EnumConstant> result = getEnumConstantsList(enumConstants);
assertThat(result.size(), is(3));
assertThat(result.get(0).getName(), is("one"));
assertThat(result.get(1).getName(), is("two"));
assertThat(result.get(2).getName(), is("three"));
}
use of com.spectralogic.ds3autogen.net.model.type.EnumConstant in project ds3_autogen by SpectraLogic.
the class BaseTypeGenerator_Test method toEnumConstants_FullList_Test.
@Test
public void toEnumConstants_FullList_Test() {
final ImmutableList<Ds3EnumConstant> enumConstants = ImmutableList.of(new Ds3EnumConstant("one", null), new Ds3EnumConstant("two", null), new Ds3EnumConstant("three", null));
final ImmutableList<EnumConstant> result = generator.toEnumConstantsList(enumConstants);
assertThat(result.size(), is(3));
assertThat(result.get(0).getName(), is("one"));
assertThat(result.get(1).getName(), is("two"));
assertThat(result.get(2).getName(), is("three"));
}
Aggregations