Search in sources :

Example 6 with EnumValue

use of com.google.api.tools.framework.model.EnumValue in project toolkit by googleapis.

the class RubyModelTypeNameConverterTest method testGetEnumValue.

@Test
public void testGetEnumValue() {
    String packageName = "Library::V1";
    TypeRef type = ModelTypeNameConverterTestUtil.getTestEnumType(tempDir);
    EnumValue value = type.getEnumType().getValues().get(0);
    RubyModelTypeNameConverter converter = new RubyModelTypeNameConverter(packageName);
    Truth.assertThat(converter.getEnumValue(type, value).getValueAndSaveTypeNicknameIn(new RubyTypeTable(packageName))).isEqualTo(":GOOD");
}
Also used : RubyTypeTable(com.google.api.codegen.util.ruby.RubyTypeTable) TypeRef(com.google.api.tools.framework.model.TypeRef) EnumValue(com.google.api.tools.framework.model.EnumValue) Test(org.junit.Test)

Aggregations

EnumValue (com.google.api.tools.framework.model.EnumValue)6 TypeRef (com.google.api.tools.framework.model.TypeRef)5 Test (org.junit.Test)5 CSharpTypeTable (com.google.api.codegen.util.csharp.CSharpTypeTable)1 GoTypeTable (com.google.api.codegen.util.go.GoTypeTable)1 JSTypeTable (com.google.api.codegen.util.js.JSTypeTable)1 PhpTypeTable (com.google.api.codegen.util.php.PhpTypeTable)1 RubyTypeTable (com.google.api.codegen.util.ruby.RubyTypeTable)1 GrpcEnumValueDocView (com.google.api.codegen.viewmodel.GrpcEnumValueDocView)1 ImmutableList (com.google.common.collect.ImmutableList)1