public void TestClearExtensionTValue() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .SetExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite, 0); Assert.IsTrue(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); builder.ClearExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite); Assert.IsFalse(builder.HasExtension(UnitTestLiteProtoFile.OptionalInt32ExtensionLite)); }
public void TestClearExtensionTList() { TestAllExtensionsLite.Builder builder = TestAllExtensionsLite.CreateBuilder() .AddExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite, 0); Assert.AreEqual(1, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); builder.ClearExtension(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite); Assert.AreEqual(0, builder.GetExtensionCount(UnitTestLiteProtoFile.RepeatedInt32ExtensionLite)); }