use of com.google.api.generator.engine.ast.ValueExpr in project gapic-generator-java by googleapis.
the class JavaWriterVisitorTest method writeValueExpr.
/**
* =============================== EXPRESSIONS ===============================
*/
@Test
public void writeValueExpr() {
Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build();
ValueExpr valueExpr = ValueExpr.builder().setValue(value).build();
valueExpr.accept(writerVisitor);
assertEquals("3", writerVisitor.write());
}
use of com.google.api.generator.engine.ast.ValueExpr in project gapic-generator-java by googleapis.
the class JavaWriterVisitorTest method writeStringObjectValue_basic.
@Test
public void writeStringObjectValue_basic() {
Value value = StringObjectValue.withValue("test");
Expr valueExpr = ValueExpr.builder().setValue(value).build();
valueExpr.accept(writerVisitor);
assertThat(writerVisitor.write()).isEqualTo("\"test\"");
}
Aggregations