Search in sources :

Example 1 with CSharpTypeTable

use of com.google.api.codegen.util.csharp.CSharpTypeTable in project toolkit by googleapis.

the class CSharpModelTypeNameConverterTest method testGetEnumValue.

@Test
public void testGetEnumValue() {
    String packageName = "Google.Example.Library.V1";
    TypeRef type = ModelTypeNameConverterTestUtil.getTestEnumType(tempDir);
    EnumValue value = type.getEnumType().getValues().get(0);
    CSharpModelTypeNameConverter converter = new CSharpModelTypeNameConverter(packageName);
    Truth.assertThat(converter.getEnumValue(type, value).getValueAndSaveTypeNicknameIn(new CSharpTypeTable(packageName))).isEqualTo("Book.Types.Rating.Good");
}
Also used : TypeRef(com.google.api.tools.framework.model.TypeRef) EnumValue(com.google.api.tools.framework.model.EnumValue) CSharpTypeTable(com.google.api.codegen.util.csharp.CSharpTypeTable) Test(org.junit.Test)

Aggregations

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