Lines Matching refs:field

327             var field = new RepeatedField<int>();
330 field.AddEntriesFrom(input, FieldCodec.ForInt32(nonPackedTag));
331 CollectionAssert.AreEqual(new[] { 10, 999, -1000 }, field);
353 var field = new RepeatedField<int>();
356 field.AddEntriesFrom(input, FieldCodec.ForInt32(packedTag));
357 CollectionAssert.AreEqual(new[] { 10, 999, -1000 }, field);
376 var field = new RepeatedField<string>();
379 field.AddEntriesFrom(input, FieldCodec.ForString(tag));
380 CollectionAssert.AreEqual(new[] { "Foo", "", "Bar" }, field);
400 var field = new RepeatedField<ForeignMessage>();
403 field.AddEntriesFrom(input, FieldCodec.ForMessage(tag, ForeignMessage.Parser));
404 CollectionAssert.AreEqual(new[] { message1, message2}, field);
412 var field = new RepeatedField<int> { 10, 1000, 1000000 };
415 field.WriteTo(output, FieldCodec.ForInt32(tag));
433 var field = new RepeatedField<int> { 10, 1000, 1000000};
436 field.WriteTo(output, FieldCodec.ForInt32(tag));
454 var field = new RepeatedField<string> { "Foo", "", "Bar" };
457 field.WriteTo(output, FieldCodec.ForString(tag));
477 var field = new RepeatedField<ForeignMessage> { message1, message2 };
480 field.WriteTo(output, FieldCodec.ForMessage(tag, ForeignMessage.Parser));
617 var field = new RepeatedField<uint>();
618 Assert.Throws<InvalidProtocolBufferException>(() => field.AddEntriesFrom(input, codec));
621 Assert.AreEqual(0, field.Count);
635 // Note that there is no content for the packed field.
636 // The field length exceeds the remaining length of content.
644 var field = new RepeatedField<uint>();
645 Assert.Throws<InvalidProtocolBufferException>(() => field.AddEntriesFrom(input, codec));
648 Assert.AreEqual(0, field.Count);
662 // Note that there is no content for the packed field.
663 // The field length exceeds the remaining length of the buffer.
673 var field = new RepeatedField<uint>();
676 field.AddEntriesFrom(ref ctx, codec);
684 Assert.AreEqual(0, field.Count);
691 var field = new RepeatedField<string> { "first", "second" };
692 IList list = field;
695 Assert.AreEqual("changed", field[1]);
728 var field = new RepeatedField<string> { "first", "second" };
729 IList list = field;