Search in sources :

Example 1 with GoTypeTable

use of com.google.api.codegen.util.go.GoTypeTable in project toolkit by googleapis.

the class GoModelTypeNameConverterTest method testGetEnumValue.

@Test
public void testGetEnumValue() {
    TypeRef type = ModelTypeNameConverterTestUtil.getTestEnumType(tempDir);
    EnumValue value = type.getEnumType().getValues().get(0);
    Truth.assertThat(converter.getEnumValue(type, value).getValueAndSaveTypeNicknameIn(new GoTypeTable())).isEqualTo("librarypb.Book_GOOD");
    type = ModelTypeNameConverterTestUtil.getTestType(tempDir, "TopLevelEnum");
    value = type.getEnumType().getValues().get(0);
    Truth.assertThat(converter.getEnumValue(type, value).getValueAndSaveTypeNicknameIn(new GoTypeTable())).isEqualTo("librarypb.TopLevelEnum_FOO");
}
Also used : GoTypeTable(com.google.api.codegen.util.go.GoTypeTable) TypeRef(com.google.api.tools.framework.model.TypeRef) EnumValue(com.google.api.tools.framework.model.EnumValue) Test(org.junit.Test)

Aggregations

GoTypeTable (com.google.api.codegen.util.go.GoTypeTable)1 EnumValue (com.google.api.tools.framework.model.EnumValue)1 TypeRef (com.google.api.tools.framework.model.TypeRef)1 Test (org.junit.Test)1