public sealed override void PrintTo(TextWriter writer) { TextFormat.Print(this, writer); }
public sealed override string ToString() { return(TextFormat.PrintToString(this)); }
public void ParseReader() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge(new StringReader(AllFieldsSetText), builder); TestUtil.AssertAllFieldsSet(builder.Build()); }
public void ParseNumericEnum() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); TextFormat.Merge("optional_nested_enum: 2", builder); Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); }
public void PrintExtensions() { string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet()); Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim()); }